/* ============================================================================
   DataSummary Pro - Mubsira Analytics Suite Stylesheet
   Unified design matching Aynalyx / DataChanges / DataVariance
   © 2026 Mubsira Analytics
   ============================================================================ */

/* ============================================================================
   CSS Variables & Design Tokens (Mubsira Unified Palette)
   ============================================================================ */
:root {
    /* Colors - Light Theme */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --primary-50: rgba(37, 99, 235, 0.08);
    --primary-100: rgba(37, 99, 235, 0.15);

    --success: #059669;
    --success-hover: #047857;
    --success-bg: #ecfdf5;
    --success-light: rgba(5, 150, 105, 0.1);

    --warning: #d97706;
    --warning-hover: #b45309;
    --warning-bg: #fffbeb;
    --warning-light: rgba(217, 119, 6, 0.1);

    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-bg: #fef2f2;
    --danger-light: rgba(220, 38, 38, 0.1);

    --info: #0891b2;
    --info-bg: #ecfeff;
    --info-light: rgba(8, 145, 178, 0.1);

    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-subtle: #f1f5f9;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-disabled: #94a3b8;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --border-light: #f1f5f9;
    --divider: #e2e8f0;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Borders */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 1000;
    --z-toast: 2000;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-bg: rgba(59, 130, 246, 0.1);
    --primary-50: rgba(59, 130, 246, 0.08);
    --primary-100: rgba(59, 130, 246, 0.15);

    --success-bg: rgba(5, 150, 105, 0.1);
    --success-light: rgba(5, 150, 105, 0.15);
    --warning-bg: rgba(217, 119, 6, 0.1);
    --warning-light: rgba(217, 119, 6, 0.15);
    --danger-bg: rgba(220, 38, 38, 0.1);
    --danger-light: rgba(220, 38, 38, 0.15);
    --info-bg: rgba(8, 145, 178, 0.1);
    --info-light: rgba(8, 145, 178, 0.15);

    --bg-page: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --bg-subtle: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-disabled: #475569;
    --border: #334155;
    --border-strong: #475569;
    --border-light: #1e293b;
    --divider: #334155;

    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-700: #cbd5e1;
    --gray-800: #e2e8f0;
    --gray-900: #f1f5f9;
}

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

/* Global SVG safety net — prevent unsized SVGs from blowing up layout */
svg:not(.quality-gauge):not(.readiness-ring) {
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0;
}
/* Icon containers must clip overflowing SVGs */
.card-icon,
.kpi-icon,
.upload-icon,
.file-info-icon,
.step-icon,
.action-icon-wrap,
.workflow-icon-wrap,
.readiness-icon,
.smart-status-icon,
.workflow-arrow {
    overflow: hidden;
}
/* Buttons & links: ensure child SVGs never exceed icon size */
button svg, .btn svg, a svg {
    width: auto;
    height: auto;
    max-width: 24px;
    max-height: 24px;
}

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

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* ============================================================================
   App Container
   ============================================================================ */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   Unified Dark Mubsira Navigation (matches Aynalyx/DataChanges/DataVariance)
   ============================================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: rgba(15, 24, 37, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.02em;
}

.nav-brand .brand-dot { color: #4a8eff; }
.nav-brand .brand-sep {
    opacity: 0.3;
    font-weight: 400;
    margin: 0 4px;
}
.nav-brand .brand-app {
    font-weight: 600;
    opacity: 0.85;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav-links a:hover { color: #fff; }

.nav-mobile-only { display: none; }
.nav-mobile-divider { display: none; }
.nav-mobile-controls { display: none; }

.nav-pro-link {
    color: #a78bfa !important;
    font-weight: 600 !important;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.nav-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.nav-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    cursor: pointer;
    background: none;
    border: none;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    background-color: #fff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ============================================================================
   Hero Section — Dark, Mubsira-style clean hero
   ============================================================================ */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0d1b2a 100%);
    padding: calc(56px + 60px) 0 40px;
    overflow: hidden;
    min-height: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.hero-bg-effects {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.hero-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-main-proposition {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out;
}

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

.hero-main-title {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 16px;
    color: #ffffff;
    line-height: 1.1;
}

.hero-main-tagline {
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Privacy Trust Block */
.hero-privacy-block {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 16px;
    padding: 20px 28px;
    margin-bottom: 36px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    animation: fadeInUp 0.6s ease-out 0.2s;
    animation-fill-mode: both;
}

.privacy-icon-large { flex-shrink: 0; color: #4ade80; }
.privacy-icon-large svg { stroke: #4ade80; }

.privacy-text-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.privacy-headline {
    font-size: 16px;
    font-weight: 700;
    color: #4ade80;
    margin: 0;
}

.privacy-detail {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    margin: 0;
}

/* Hero CTA Buttons */
.hero-cta-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 0.6s ease-out 0.4s;
    animation-fill-mode: both;
}

.btn-hero-primary {
    background: #1E40AF;
    color: white;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
    border: none;
}

.btn-hero-primary:hover {
    background: #1E3A8A;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.35);
}

.btn-hero-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-glow {
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.35);
}

/* ============================================================================
   Tool Section
   ============================================================================ */
.tool-section {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    scroll-margin-top: 80px;
}

/* ============================================================================
   Upload Section
   ============================================================================ */
.upload-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.upload-area {
    padding: var(--space-12) var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px dashed transparent;
    margin: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
}

.upload-area:hover,
.upload-area.dragover {
    background: var(--primary-50);
    border-color: var(--primary);
}

.upload-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.upload-area:hover .upload-icon {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

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

.upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.upload-link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.upload-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    background: var(--success-light);
    border-top: 1px solid var(--border);
}

.file-info-icon {
    width: 40px;
    height: 40px;
    background: var(--success);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-info-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.file-info-details {
    flex: 1;
}

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

.file-status {
    font-size: 0.8125rem;
    color: var(--success);
}

/* File Info Action Buttons */
.file-info-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    transition: stroke var(--transition);
}

.btn-icon:hover {
    background: var(--bg-subtle);
}

.btn-icon:hover svg {
    stroke: var(--text-primary);
}

.btn-preview:hover {
    background: var(--primary-bg);
}

.btn-preview:hover svg {
    stroke: var(--primary);
}

.btn-remove:hover {
    background: var(--danger-bg);
}

.btn-remove:hover svg {
    stroke: var(--danger);
}

/* ============================================================================
   Results Section
   ============================================================================ */
.results-section {
    padding-bottom: var(--space-12);
    animation: fadeIn 0.3s ease;
}

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

/* ============================================================================
   Cards
   ============================================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

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

.card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25em 0.625em;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

/* ============================================================================
   Buttons
   ============================================================================ */
button, .btn {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition);
    background: var(--primary);
    color: white;
}

button:hover, .btn:hover {
    background: var(--primary-hover);
}

button:disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button svg, .btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--border-strong);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-pro {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    position: relative;
}

.btn-pro:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.btn-pro .pro-badge {
    font-size: 0.5625rem;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
    margin-left: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
}

.btn-ghost:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: 15px;
}

/* ============================================================================
   KPIs
   ============================================================================ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
}

.kpi-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    border: 1px solid transparent;
    transition: all var(--transition);
}

.kpi-card:hover {
    border-color: var(--border);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--primary-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--primary);
}

.kpi-content { flex: 1; }

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

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

/* KPI Variants */
.kpi-card.info .kpi-icon { background: var(--info-light); }
.kpi-card.info .kpi-icon svg { stroke: var(--info); }
.kpi-card.info .kpi-value { color: var(--info); }

.kpi-card.warning .kpi-icon { background: var(--warning-light); }
.kpi-card.warning .kpi-icon svg { stroke: var(--warning); }
.kpi-card.warning .kpi-value { color: var(--warning); }

.kpi-card.danger .kpi-icon { background: var(--danger-light); }
.kpi-card.danger .kpi-icon svg { stroke: var(--danger); }
.kpi-card.danger .kpi-value { color: var(--danger); }

.kpi-card.success .kpi-icon { background: var(--success-light); }
.kpi-card.success .kpi-icon svg { stroke: var(--success); }
.kpi-card.success .kpi-value { color: var(--success); }

/* Quality Score KPI Card */
.kpi-card.kpi-quality {
    position: relative;
    flex-direction: row;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-subtle), var(--bg-card));
    border: 1.5px solid var(--border);
}
.kpi-card.kpi-quality.success { border-color: var(--success); background: linear-gradient(135deg, var(--success-bg), var(--bg-card)); }
.kpi-card.kpi-quality.warning { border-color: var(--warning); background: linear-gradient(135deg, var(--warning-bg), var(--bg-card)); }
.kpi-card.kpi-quality.danger  { border-color: var(--danger);  background: linear-gradient(135deg, var(--danger-bg), var(--bg-card));  }

.kpi-quality-gauge {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}
.quality-gauge { width: 100%; height: 100%; }
.kpi-quality.success .quality-gauge { color: var(--success); }
.kpi-quality.warning .quality-gauge { color: var(--warning); }
.kpi-quality.danger  .quality-gauge { color: var(--danger); }
.quality-arc {
    transition: stroke-dashoffset 1s ease-out;
}

.kpi-quality .kpi-value {
    font-size: 1.1rem;
}
.kpi-quality.success .kpi-value { color: var(--success); }
.kpi-quality.warning .kpi-value { color: var(--warning); }
.kpi-quality.danger  .kpi-value { color: var(--danger); }

/* ============================================================================
   Column Health Indicator
   ============================================================================ */
.col-health {
    width: 28px;
    text-align: center;
    padding: 0.5rem 0.25rem !important;
}
.health-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}
.health-dot.good    { background: var(--success-bg); color: var(--success); }
.health-dot.warning { background: var(--warning-bg); color: var(--warning); }
.health-dot.critical { background: var(--danger-bg); color: var(--danger); }

/* ============================================================================
   Completeness Bar
   ============================================================================ */
.completeness-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
}
.completeness-bar-bg {
    width: 100%;
    height: 5px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.completeness-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s ease-out;
}
.completeness-bar.comp-high { background: var(--success); }
.completeness-bar.comp-mid  { background: var(--warning); }
.completeness-bar.comp-low  { background: var(--danger); }
.completeness-pct {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}
.missing-count {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* ============================================================================
   Pattern Badge
   ============================================================================ */
.pattern-badge {
    display: inline-flex;
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.2em 0.5em;
    border-radius: var(--radius-sm);
    background: var(--primary-50);
    color: var(--primary);
    white-space: nowrap;
}
.pattern-badge.pattern-freetext {
    background: var(--bg-subtle);
    color: var(--text-muted);
}
.pattern-badge.pattern-type {
    background: transparent;
    color: var(--text-muted);
    font-style: italic;
}
.pattern-badge.pattern-lg {
    font-size: 0.8125rem;
    padding: 0.35em 0.75em;
}

/* ============================================================================
   Enhanced Column Detail Modal
   ============================================================================ */
.detail-health-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
}
.detail-health-banner.good    { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.detail-health-banner.warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.detail-health-banner.critical { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-section {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
}
.detail-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-pattern-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}
.pattern-confidence {
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.pattern-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}
.pattern-example {
    padding: 2px 8px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.detail-insights-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.detail-insight-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    min-width: 80px;
    text-align: center;
}
.detail-insight-chip .insight-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}
.detail-insight-chip .insight-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.detail-insight-chip.warning { background: var(--warning-bg); border-color: var(--warning); }
.detail-insight-chip.warning .insight-value { color: var(--warning); }
.detail-insight-chip.info { background: var(--info-bg); border-color: var(--info); }
.detail-insight-chip.info .insight-value { color: var(--info); }
.detail-insight-chip.success { background: var(--success-bg); border-color: var(--success); }
.detail-insight-chip.success .insight-label { color: var(--success); font-weight: 500; }

.detail-dist-table {
    width: 100%;
    margin-top: 0.5em;
    font-size: 0.875rem;
}

/* ============================================================================
   Copy Summary Button
   ============================================================================ */
.btn-copy {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-copy:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================================================
   Table Legend
   ============================================================================ */
.card-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-1);
    font-size: 0.75rem;
    color: var(--text-muted);
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================================
   Tables
   ============================================================================ */
.table-wrapper {
    overflow-x: auto;
    margin: var(--space-4) 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

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

tbody tr {
    transition: background var(--transition);
    cursor: pointer;
}

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

/* Type Badge */
.type-badge {
    display: inline-flex;
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.25em 0.5em;
    border-radius: var(--radius-sm);
    text-transform: capitalize;
}

.type-badge.numeric { background: #dcfce7; color: #166534; }
.type-badge.text { background: #fef3c7; color: #92400e; }
.type-badge.date { background: #dbeafe; color: #1e40af; }
.type-badge.boolean { background: #fce7f3; color: #9d174d; }
.type-badge.empty { background: var(--bg-subtle); color: var(--text-muted); }
.type-badge.mixed { background: #fee2e2; color: #991b1b; }

[data-theme="dark"] .type-badge.numeric { background: #14532d; color: #bbf7d0; }
[data-theme="dark"] .type-badge.text { background: #78350f; color: #fde68a; }
[data-theme="dark"] .type-badge.date { background: #1e3a8a; color: #bfdbfe; }
[data-theme="dark"] .type-badge.boolean { background: #831843; color: #fbcfe8; }
[data-theme="dark"] .type-badge.mixed { background: #7f1d1d; color: #fecaca; }

/* Truncated text cells */
.cell-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    cursor: help;
}

.cell-sample {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: help;
}

/* Sample value chips */
.sample-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 220px;
}

.sample-chip {
    display: inline-block;
    max-width: 80px;
    padding: 2px 6px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

.sample-chip:hover {
    background: var(--primary-100);
    color: var(--primary-hover);
}

.sample-more {
    padding: 2px 6px;
    background: var(--primary-50);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}

.sample-more:hover {
    background: var(--primary-100);
}

/* Distribution Bar */
.dist-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.dist-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* ============================================================================
   Actions Bar
   ============================================================================ */
.actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-light);
    justify-content: flex-end;
}

/* ============================================================================
   Data Preview Modal
   ============================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.modal-overlay.show {
    display: flex;
}

.modal-dialog {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.2s ease;
}

.modal-lg { max-width: 560px; }
.modal-xl { max-width: 900px; }

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 24px;
}

.modal-close:hover {
    background: var(--bg-subtle);
    color: var(--danger);
}

.modal-body {
    padding: var(--space-6);
}

.preview-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 8px;
    background: var(--bg-subtle);
    color: var(--text-muted);
    border-radius: 100px;
}

.preview-table-container {
    max-height: 60vh;
    overflow: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.preview-table th,
.preview-table td {
    padding: var(--space-1) var(--space-2);
    text-align: left;
    border: 1px solid var(--border);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.preview-table tbody tr:nth-child(even) {
    background: var(--bg-subtle);
}

.preview-table tbody tr:hover {
    background: var(--primary-50);
}

.preview-table .row-number {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    background: var(--bg-subtle);
    min-width: 40px;
}

/* Column Detail Modal */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8125rem;
}

/* ============================================================================
   Smart Analysis Panel
   ============================================================================ */
.smart-analysis-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    border-left: 4px solid var(--primary);
}

.smart-status {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.smart-status-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--success-light);
    color: var(--success);
}

.smart-status-icon svg { width: 20px; height: 20px; }

.smart-status-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.smart-status-content p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.smart-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.smart-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.smart-chip svg { width: 12px; height: 12px; color: var(--primary); }
.chip-label { color: var(--text-muted); }
.chip-value { font-weight: 600; color: var(--text-primary); }

.smart-insights {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-4);
}

.smart-insights li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) 0;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.smart-insights .insight-icon { width: 16px; height: 16px; flex-shrink: 0; }
.smart-insights .insight-icon.success { color: var(--success); }
.smart-insights .insight-icon.warning { color: var(--warning); }
.smart-insights .insight-icon.info { color: var(--primary); }
.smart-insights .insight-icon.danger { color: var(--danger); }

.smart-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.smart-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: var(--success);
    color: white;
    transition: all var(--transition);
}

.smart-btn-primary:hover {
    background: var(--success-hover);
}

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

.smart-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1.5px solid var(--border);
    cursor: pointer;
    background: transparent;
    color: var(--text-primary);
    transition: all var(--transition);
}

.smart-btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* ============================================================================
   Onboarding Modal
   ============================================================================ */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.onboarding-modal {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-8);
    max-width: 480px;
    width: 100%;
    text-align: center;
    animation: modalSlideIn 0.2s ease;
}

.onboarding-header {
    margin-bottom: var(--space-4);
}

.onboarding-icon {
    display: inline-flex;
    width: 64px;
    height: 64px;
    background: var(--primary-bg);
    border-radius: var(--radius-lg);
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.onboarding-modal h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.onboarding-tagline {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}

.onboarding-steps {
    text-align: left;
    margin-bottom: var(--space-6);
}

.onboarding-step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-light);
}

.onboarding-step:last-child { border-bottom: none; }

.step-number {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.step-content p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.onboarding-start {
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin-bottom: var(--space-3);
}

.onboarding-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.onboarding-actions .onboarding-start {
    margin-bottom: 0;
}
.onboarding-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}
.onboarding-close:hover {
    color: var(--text);
}

.onboarding-remember {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
}

.onboarding-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ============================================================================
   License Modal
   ============================================================================ */
.license-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.license-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 440px;
    width: 100%;
    animation: modalSlideIn 0.2s ease;
}

.license-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border);
}

.license-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.license-modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.license-modal-close:hover {
    background: var(--bg-subtle);
    color: var(--danger);
}

.license-modal-body {
    padding: var(--space-6);
    text-align: center;
}

.license-modal-body > p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.license-price {
    margin-bottom: var(--space-6);
}

.license-price-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.license-price-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.license-btn-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--success);
    color: white;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    margin-bottom: var(--space-4);
}

.license-btn-buy:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.license-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-4) 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.license-divider::before,
.license-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.license-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    font-size: 1rem;
    font-family: var(--font-mono);
    text-align: center;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-3);
    background: var(--bg-page);
    color: var(--text-primary);
}

.license-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-50);
}

.license-error {
    font-size: 0.8125rem;
    color: var(--danger);
    margin-bottom: var(--space-3);
}

.license-modal-footer {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.license-btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--transition);
}

.license-btn-secondary:hover {
    background: var(--gray-200);
}

.license-btn-primary {
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
}

.license-btn-primary:hover {
    background: var(--primary-hover);
}

.license-btn-danger {
    padding: 0.5rem 1.25rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
}
.license-btn-danger:hover {
    opacity: 0.85;
}

/* ============================================================================
   Toast
   ============================================================================ */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast-notification {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    animation: toastSlideIn 0.3s ease;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-notification.toast-success { border-left: 4px solid var(--success); }
.toast-notification.toast-error { border-left: 4px solid var(--danger); }
.toast-notification.toast-warning { border-left: 4px solid var(--warning); }
.toast-notification.toast-info { border-left: 4px solid var(--primary); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Legacy toast (for backwards compat with app.js) */
.toast {
    position: fixed;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: var(--z-toast);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-slow);
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: #1e1e2e; }

/* ============================================================================
   How It Works Section
   ============================================================================ */
.how-it-works {
    background: var(--bg-page);
    border-top: 1px solid var(--border);
    padding: var(--space-12) var(--space-6);
    scroll-margin-top: 56px;
}

.how-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.section-overline {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin-bottom: 8px;
}

.how-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.how-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 40px 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transition: all 0.2s;
}

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

.step-card.highlighted {
    border-color: var(--primary);
    background: linear-gradient(180deg, var(--primary-bg) 0%, var(--bg-card) 100%);
}

/* Note: .step-number inside .how-it-works overrides the onboarding .step-number */
.how-it-works .step-number {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon {
    width: 64px;
    height: 64px;
    margin: 8px auto 16px;
    background: var(--primary-bg);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--primary);
}

.step-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.step-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ============================================================================
   Trust / Privacy Banner
   ============================================================================ */
.mubsira-trust-banner {
    background-color: #f5f5f7;
    border-top: 1px solid #d4d6dc;
    border-bottom: 1px solid #d4d6dc;
    padding: 16px 24px;
}
.trust-banner-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}
.trust-banner-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #3b4258;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.trust-banner-item svg {
    color: #1a2b4a;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .trust-banner-inner { gap: 12px; justify-content: flex-start; }
    .trust-banner-item { font-size: 11px; }
}

/* ============================================================================
   Unified Dark Footer (matches Aynalyx/DataChanges/DataVariance)
   ============================================================================ */
.site-footer {
    background-color: #0f1825;
    padding: 32px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.footer-links {
    display: flex;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links a {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-links a:hover { color: rgba(255, 255, 255, 0.8); }

/* ============================================================================
   Utility
   ============================================================================ */
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    /* --- Prevent horizontal overflow from navbar --- */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .site-header {
        overflow: hidden;
    }

    .nav-container {
        padding: 0 var(--space-3);
        overflow: hidden;
        max-width: 100vw;
    }

    .nav-brand {
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        font-size: 14px;
    }

    .nav-brand .brand-sep,
    .nav-brand .brand-app {
        display: none;
    }

    .nav-right {
        flex-shrink: 1;
        min-width: 0;
        gap: var(--space-1);
        overflow: hidden;
    }

    .nav-actions {
        gap: 2px;
        flex-shrink: 0;
    }

    .nav-actions .nav-upgrade-btn {
        display: none;
    }

    .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .nav-links {
        display: none;
    }

    .nav-links.is-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background-color: rgba(15, 24, 37, 0.97);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding: var(--space-4);
        gap: var(--space-2);
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }

    .nav-links.is-open .nav-mobile-only {
        display: list-item;
    }

    .nav-links.is-open .nav-mobile-controls {
        display: flex;
        gap: var(--space-2);
        padding-top: var(--space-2);
    }

    .nav-toggle {
        display: flex;
    }

    .hero-section {
        padding: calc(56px + 28px) var(--space-4) 24px;
    }

    .hero-main-proposition {
        margin-bottom: 20px;
    }

    .hero-main-title {
        font-size: 28px;
        letter-spacing: -1px;
    }

    .hero-main-tagline {
        font-size: 14px;
        line-height: 1.5;
    }

    .hero-privacy-block {
        padding: 14px 16px;
        margin-bottom: 24px;
        gap: 12px;
    }

    .privacy-icon-large svg {
        width: 24px;
        height: 24px;
    }

    .privacy-headline {
        font-size: 14px;
    }

    .privacy-detail {
        font-size: 13px;
    }

    .hero-cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-large {
        width: 100%;
        justify-content: center;
    }

    .tool-section {
        padding: var(--space-6) var(--space-4);
    }

    .upload-area {
        padding: var(--space-8) var(--space-4);
    }

    .upload-icon {
        width: 56px;
        height: 56px;
    }

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

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

    .actions-bar {
        justify-content: center;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .step-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .smart-status {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .smart-chips {
        justify-content: center;
    }

    .smart-actions {
        flex-direction: column;
        gap: var(--space-3);
    }

    .smart-btn-primary,
    .smart-btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* --- Column Summary Table: hide less-important columns on mobile --- */
    #columnSummaryTable th:nth-child(4),  /* Pattern */
    #columnSummaryTable td:nth-child(4),
    #columnSummaryTable th:nth-child(7),  /* Min */
    #columnSummaryTable td:nth-child(7),
    #columnSummaryTable th:nth-child(8),  /* Max */
    #columnSummaryTable td:nth-child(8),
    #columnSummaryTable th:nth-child(9),  /* Mean */
    #columnSummaryTable td:nth-child(9),
    #columnSummaryTable th:nth-child(10), /* Most Common */
    #columnSummaryTable td:nth-child(10),
    #columnSummaryTable th:nth-child(11), /* Sample Values */
    #columnSummaryTable td:nth-child(11) {
        display: none;
    }

    /* Keep the remaining columns compact */
    #columnSummaryTable th,
    #columnSummaryTable td {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    #columnSummaryTable td strong {
        font-size: 0.72rem;
        word-break: break-word;
        white-space: normal;
    }

    /* Completeness bar compact */
    .completeness-cell {
        min-width: 70px;
    }
    .completeness-cell .missing-count {
        display: none;
    }

    /* Make table wrapper scrollable as fallback */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: var(--space-3) 0;
    }

    /* --- Column Detail Modal: full-width and compact on mobile --- */
    .modal-overlay {
        padding: var(--space-2);
        align-items: flex-start;
        padding-top: 60px;
    }

    .modal-dialog {
        max-width: 100%;
        max-height: calc(100vh - 70px);
        border-radius: var(--radius-md);
    }

    .modal-dialog.modal-lg {
        max-width: 100%;
    }

    .modal-header {
        padding: var(--space-3) var(--space-4);
    }

    .modal-header h3 {
        font-size: 0.95rem;
    }

    .modal-body {
        padding: var(--space-4);
    }

    .detail-health-banner {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
        padding: var(--space-3);
        font-size: 0.8rem;
    }

    .detail-row {
        padding: 0.5rem 0;
    }

    .detail-label,
    .detail-value {
        font-size: 0.75rem;
    }

    .detail-value {
        max-width: 55%;
        text-align: right;
        word-break: break-word;
    }

    .detail-section-title {
        font-size: 0.78rem;
    }

    .detail-dist-table th,
    .detail-dist-table td {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }

    .detail-insight-chip {
        min-width: 60px;
        padding: var(--space-2);
    }

    .detail-insight-chip .insight-value {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .kpi-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .kpi-icon {
        width: 32px;
        height: 32px;
    }

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

    .kpi-value {
        font-size: 1.15rem;
    }

    .kpi-label {
        font-size: 0.7rem;
    }

    .kpi-desc {
        font-size: 0.65rem;
    }

    .onboarding-modal {
        padding: var(--space-6);
    }

    .hero-main-title {
        font-size: 24px;
    }

    .how-title {
        font-size: 24px;
    }

    .how-it-works {
        padding: var(--space-8) var(--space-4);
    }

    .btn-large {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* --- File name overflow prevention --- */
    .file-info {
        overflow: hidden;
        padding: var(--space-3) var(--space-4);
    }

    .file-info-details {
        min-width: 0;
        overflow: hidden;
    }

    .file-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
        font-size: 0.8rem;
    }

    /* --- Card improvements for mobile --- */
    .card {
        padding: var(--space-4);
        margin-bottom: var(--space-4);
        border-radius: var(--radius-md);
        overflow: hidden;
    }

    .card-header {
        gap: var(--space-3);
        margin-bottom: var(--space-3);
        flex-wrap: wrap;
    }

    .card-icon {
        width: 32px;
        height: 32px;
    }

    .card-icon svg {
        width: 16px;
        height: 16px;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .card-desc {
        font-size: 0.78rem;
        margin-bottom: var(--space-3);
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* --- Collapsible card sections on mobile --- */
    .card-header.collapsible-header {
        cursor: pointer;
        position: relative;
        padding-right: 28px;
        user-select: none;
        -webkit-user-select: none;
    }

    .card-header.collapsible-header::after {
        content: '';
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--text-muted);
        border-bottom: 2px solid var(--text-muted);
        transform: translateY(-50%) rotate(45deg);
        transition: transform 0.25s ease;
    }

    .card-header.collapsible-header.collapsed::after {
        transform: translateY(-50%) rotate(-45deg);
    }

    .card-body-collapsible {
        overflow: hidden;
        transition: max-height 0.35s ease, opacity 0.25s ease;
        max-height: 5000px;
        opacity: 1;
    }

    .card-body-collapsible.collapsed {
        max-height: 0;
        opacity: 0;
    }

    /* --- Table text containment --- */
    .table-wrapper {
        margin: var(--space-3) 0;
    }

    th, td {
        padding: 0.5rem 0.6rem;
        font-size: 0.72rem;
        word-break: break-word;
    }

    /* --- Column table: also hide Unique Values on very small screens --- */
    #columnSummaryTable th:nth-child(6),
    #columnSummaryTable td:nth-child(6) {
        display: none;
    }

    #columnSummaryTable th,
    #columnSummaryTable td {
        padding: 0.35rem 0.4rem;
        font-size: 0.65rem;
    }

    /* --- Column Detail Modal even more compact --- */
    .modal-overlay {
        padding: 0;
        padding-top: 56px;
    }

    .modal-dialog {
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: calc(100vh - 56px);
    }

    .modal-body {
        padding: var(--space-3);
    }

    /* --- Actions bar mobile --- */
    .actions-bar {
        gap: var(--space-2);
        margin-top: var(--space-4);
        padding-top: var(--space-4);
        justify-content: center;
    }

    .actions-bar .btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

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

    /* --- Action items mobile --- */
    .action-item {
        flex-direction: column;
        gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
    }

    .action-icon-wrap {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .action-icon-wrap svg {
        width: 16px;
        height: 16px;
    }

    .action-title {
        font-size: 0.85rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .action-desc {
        font-size: 0.75rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .action-header {
        flex-wrap: wrap;
        gap: 4px;
    }

    .action-priority-badge,
    .action-type-badge {
        font-size: 0.6rem;
    }

    /* --- Readiness grid mobile --- */
    .readiness-item {
        padding: var(--space-3) var(--space-4);
        gap: var(--space-3);
    }

    .readiness-gauge {
        width: 44px;
        height: 44px;
    }

    .readiness-label {
        font-size: 0.82rem;
    }

    .readiness-status {
        font-size: 0.65rem;
    }

    .readiness-blockers li {
        font-size: 0.7rem;
    }

    /* --- Workflow items mobile --- */
    .workflow-item {
        padding: var(--space-3) var(--space-4);
        gap: var(--space-3);
    }

    .workflow-icon-wrap {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

    .workflow-icon-wrap svg {
        width: 18px;
        height: 18px;
    }

    .workflow-name {
        font-size: 0.88rem;
    }

    .workflow-subtitle {
        font-size: 0.72rem;
    }

    .workflow-desc {
        font-size: 0.72rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .workflow-recommended-badge {
        font-size: 0.58rem;
        padding: 1px 7px;
    }

    .workflow-arrow {
        width: 26px;
        height: 26px;
    }

    .workflow-arrow svg {
        width: 13px;
        height: 13px;
    }

    /* --- Card legend mobile --- */
    .card-legend {
        flex-wrap: wrap;
        gap: 6px;
    }

    .legend-item {
        font-size: 0.7rem;
    }

    /* --- Floating restart button on mobile --- */
    .mobile-floating-restart {
        display: flex;
        position: fixed;
        bottom: 20px;
        right: 16px;
        z-index: 99;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: var(--radius-full);
        padding: 12px 20px;
        font-size: 0.85rem;
        font-weight: 600;
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
        align-items: center;
        gap: 8px;
        cursor: pointer;
        transition: all 0.25s ease;
        animation: floatIn 0.4s ease;
    }

    .mobile-floating-restart:hover {
        background: var(--primary-hover);
        transform: translateY(-2px);
        box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
    }

    .mobile-floating-restart svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

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

/* Floating restart - hidden on desktop by default */
.mobile-floating-restart {
    display: none;
}

/* ============================================================================
   Dark Mode Adjustments
   ============================================================================ */
[data-theme="dark"] .upload-area {
    border-color: transparent;
}

[data-theme="dark"] .upload-area:hover,
[data-theme="dark"] .upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

[data-theme="dark"] .upload-icon {
    background: var(--bg-elevated);
}

[data-theme="dark"] .smart-analysis-panel {
    background: var(--bg-card);
}

[data-theme="dark"] .smart-chip {
    background: var(--bg-elevated);
}

[data-theme="dark"] .smart-btn-secondary {
    background: var(--bg-elevated);
}

[data-theme="dark"] .step-card {
    background: var(--bg-card);
}

[data-theme="dark"] .step-card.highlighted {
    background: linear-gradient(180deg, var(--primary-bg) 0%, var(--bg-card) 100%);
}

[data-theme="dark"] .step-icon {
    background: var(--primary-bg);
}

/* ============================================================================
   ACTIONABLE INTELLIGENCE - Action Items Card
   ============================================================================ */
.action-intelligence-card,
.readiness-card,
.workflow-card {
    animation: slideUpFade 0.5s ease-out;
}

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

.card-icon-action { color: var(--primary); }
.card-icon-readiness { color: var(--success); }
.card-icon-workflow { color: var(--info); }

.card-badge-action {
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
}
.card-badge-action.badge-critical {
    background: var(--danger-bg);
    color: var(--danger);
}
.card-badge-action.badge-high {
    background: var(--warning-bg);
    color: var(--warning);
}
.card-badge-action.badge-ok {
    background: var(--success-bg);
    color: var(--success);
}

/* --- Action Items List --- */
.action-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.action-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.action-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}
.action-item.action-critical::before { background: var(--danger); }
.action-item.action-high::before { background: var(--warning); }
.action-item.action-medium::before { background: var(--primary); }
.action-item.action-low::before { background: var(--gray-400); }
.action-item.action-success::before { background: var(--success); }

.action-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
    transform: translateX(2px);
}

.action-icon-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.action-icon-wrap svg {
    width: 20px;
    height: 20px;
}
.action-icon-critical {
    background: var(--danger-bg);
    color: var(--danger);
}
.action-icon-high {
    background: var(--warning-bg);
    color: var(--warning);
}
.action-icon-medium {
    background: var(--primary-bg);
    color: var(--primary);
}
.action-icon-low {
    background: var(--gray-100);
    color: var(--gray-500);
}
.action-icon-success {
    background: var(--success-bg);
    color: var(--success);
}

.action-content {
    flex: 1;
    min-width: 0;
}

.action-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.action-priority-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1.4;
}
.priority-critical { background: var(--danger-bg); color: var(--danger); }
.priority-high { background: var(--warning-bg); color: var(--warning); }
.priority-medium { background: var(--primary-bg); color: var(--primary); }
.priority-low { background: var(--gray-100); color: var(--gray-500); }
.priority-success { background: var(--success-bg); color: var(--success); }

.action-type-badge {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--gray-100);
}

.action-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
    line-height: 1.3;
}

.action-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.action-footer {
    margin-top: 10px;
}

.action-tool-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--primary-50);
    transition: all 0.2s;
}
.action-tool-link svg {
    width: 14px;
    height: 14px;
}
.action-tool-link:hover {
    background: var(--primary-100);
    transform: translateX(2px);
}

/* ============================================================================
   ACTIONABLE INTELLIGENCE - Data Readiness Card
   ============================================================================ */
.readiness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.readiness-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    transition: all 0.2s;
}
.readiness-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.readiness-gauge {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}

.readiness-ring {
    width: 100%;
    height: 100%;
}
.readiness-good .readiness-ring { color: var(--success); }
.readiness-fair .readiness-ring { color: var(--warning); }
.readiness-poor .readiness-ring { color: var(--danger); }
.readiness-na .readiness-ring { color: var(--gray-300); }

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

.readiness-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.readiness-title-row .readiness-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}
.readiness-title-row .readiness-icon svg {
    width: 18px;
    height: 18px;
}

.readiness-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.readiness-status {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}
.readiness-status.readiness-good { background: var(--success-bg); color: var(--success); }
.readiness-status.readiness-fair { background: var(--warning-bg); color: var(--warning); }
.readiness-status.readiness-poor { background: var(--danger-bg); color: var(--danger); }
.readiness-status.readiness-na   { background: var(--gray-100); color: var(--gray-500); }

.readiness-blockers {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
}
.readiness-blockers li {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding-left: 14px;
    position: relative;
}
.readiness-blockers li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--warning);
    font-weight: 700;
}

/* ============================================================================
   ACTIONABLE INTELLIGENCE - What's Next / Workflow Card
   ============================================================================ */
.workflow-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.workflow-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.workflow-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}
.workflow-item.workflow-is-recommended {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, var(--bg) 0%, var(--primary-bg) 100%);
}
.workflow-item.workflow-is-recommended:hover {
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--bg) 100%);
}

.workflow-icon-wrap {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.workflow-icon-wrap svg {
    width: 24px;
    height: 24px;
}
.workflow-urgent .workflow-icon-wrap {
    background: var(--warning-bg);
    color: var(--warning);
}

.workflow-content {
    flex: 1;
    min-width: 0;
}

.workflow-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.workflow-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.workflow-recommended-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    border-radius: 99px;
    background: var(--primary);
    color: #fff;
    line-height: 1.5;
}

.workflow-subtitle {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 4px;
    letter-spacing: 0.02em;
}

.workflow-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.workflow-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}
.workflow-arrow svg {
    width: 16px;
    height: 16px;
}
.workflow-item:hover .workflow-arrow {
    background: var(--primary);
    color: #fff;
    transform: translateX(4px);
}

/* ============================================================================
   ACTIONABLE INTELLIGENCE - Dark Theme Overrides
   ============================================================================ */
[data-theme="dark"] .action-item {
    background: var(--bg-elevated);
    border-color: var(--border);
}
[data-theme="dark"] .action-item:hover {
    border-color: var(--primary);
}
[data-theme="dark"] .action-type-badge {
    background: var(--bg-card);
    color: var(--text-muted);
}
[data-theme="dark"] .readiness-item {
    background: var(--bg-elevated);
}
[data-theme="dark"] .workflow-item {
    background: var(--bg-elevated);
}
[data-theme="dark"] .workflow-item.workflow-is-recommended {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--primary-bg) 100%);
}
[data-theme="dark"] .workflow-arrow {
    background: var(--bg-card);
    color: var(--gray-500);
}
[data-theme="dark"] .action-tool-link {
    background: rgba(37, 99, 235, 0.15);
}
[data-theme="dark"] .action-icon-low {
    background: var(--bg-card);
    color: var(--gray-400);
}
[data-theme="dark"] .workflow-icon-wrap {
    background: rgba(37, 99, 235, 0.15);
}
[data-theme="dark"] .workflow-urgent .workflow-icon-wrap {
    background: rgba(217, 119, 6, 0.15);
}

/* ============================================================================
   ACTIONABLE INTELLIGENCE - Responsive
   ============================================================================ */
@media (max-width: 768px) {
    .readiness-grid {
        grid-template-columns: 1fr;
    }
    .action-item {
        padding: 14px 16px;
        gap: 12px;
    }
    .action-icon-wrap {
        width: 36px;
        height: 36px;
    }
    .action-icon-wrap svg {
        width: 18px;
        height: 18px;
    }
    .workflow-item {
        padding: 16px 18px;
        gap: 12px;
    }
    .workflow-icon-wrap {
        width: 40px;
        height: 40px;
    }
    .workflow-icon-wrap svg {
        width: 20px;
        height: 20px;
    }
    .readiness-gauge {
        width: 50px;
        height: 50px;
    }
}
