/* ==========================================================================
   FYXIN ISOMETRIC DRAWING EXTRACTOR — Enterprise Design System
   Clean, Premium, Modern Industrial Light Theme
   Primary Canvas: #F5F2EC
   ========================================================================== */

:root {
    /* Core Color Palette - Light Industrial System */
    --bg-canvas: #F5F2EC;         /* Primary Warm Industrial Base */
    --bg-surface: #FFFFFF;        /* Elevated Surface White */
    --bg-card: #FFFFFF;           /* Card White */
    --bg-card-subtle: #FAF8F5;    /* Subtle Off-White Card */
    --bg-sidebar: #EFEBE4;        /* Distinguishable Sidebar */
    --bg-input: #FFFFFF;          /* Form Control Surface */
    --bg-inset: #ECE7DF;          /* Nested Data Box Surface */
    
    /* Borders & Dividers */
    --border-subtle: #E2DCD3;     /* Standard Content Border */
    --border-medium: #D5CDC0;     /* Elevated Card Border */
    --border-focus: #2563eb;      /* Brand Cobalt Focus */
    --border-hover: #C5BCAD;      /* Interactive Hover Border */
    
    /* Typography - Deep Contrast Neutrals */
    --text-main: #1C1917;         /* High-Contrast Charcoal Heading & Body */
    --text-secondary: #44403C;    /* Secondary Details & Labels */
    --text-muted: #78716C;        /* Timestamps, Subtitles, Meta */
    --text-inverse: #FFFFFF;      /* On-Primary Dark/Cobalt Contrast */
    
    /* Brand Accent - Cobalt Blue (Matching FYXIN Logo Accent) */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --primary-glow: rgba(37, 99, 235, 0.15);
    
    /* Semantic Status Colors */
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #065f46;
    
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;
    
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;
    
    --info: #0284c7;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;
    --info-text: #0369a1;
    
    /* Shadows - Minimal, Crisp SaaS Elevatons */
    --shadow-sm: 0 1px 2px 0 rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.06), 0 2px 4px -2px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.03);
    
    /* Layout Dimensions */
    --header-height: 64px;
    --sidebar-width: 256px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --transition-fast: 0.15s ease;
}

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* App Layout Grid - Static 100vh Viewport */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Header - Static Pinned Top */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

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

.brand-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: transparent;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--text-main);
}

.brand-subtitle {
    font-size: 0.73rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.system-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--success-text);
}

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

.status-indicator-dot.pulse {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5);
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

.status-indicator-dot.status-connected {
    background-color: var(--success);
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5);
}

.status-indicator-dot.status-processing {
    background-color: var(--primary);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5);
    animation: dotPulsePrimary 1.5s infinite;
}

.status-indicator-dot.status-offline {
    background-color: var(--warning);
    box-shadow: none;
    animation: none;
}

.status-indicator-dot.status-error {
    background-color: var(--danger);
    box-shadow: none;
    animation: none;
}

@keyframes dotPulsePrimary {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.user-session-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.chip-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.chip-text {
    color: var(--text-secondary);
    font-weight: 600;
}

/* App Body: Sidebar + Main */
.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* Sidebar - Static, Immovable Architecture */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    flex-shrink: 0;
    height: 100%;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    padding: 24px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    position: relative;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 0 12px 14px 12px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
    width: 100%;
}

.nav-item:hover {
    background-color: #E6E0D5;
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--bg-surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    display: block;
}

.nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    background-color: #E2DBD0;
    border: 1px solid var(--border-subtle);
    padding: 2px 7px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.spec-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.spec-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
}

.spec-desc {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 3px 0 6px 0;
}

.spec-tag {
    display: inline-block;
    font-size: 0.65rem;
    background-color: var(--primary-light);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Main Area */
.app-main {
    flex: 1;
    background-color: var(--bg-canvas);
    padding: 32px 40px;
    overflow-y: auto;
}

.content-view {
    display: none;
    animation: fadeIn 0.15s ease-in-out;
}

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

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

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

.view-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

.view-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 4px;
    max-width: 820px;
}

/* Mode Selector Switcher */
.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    cursor: pointer;
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

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

.mode-btn.active {
    border-color: var(--primary);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}

.mode-icon {
    font-size: 1.6rem;
}

.mode-text-group {
    display: flex;
    flex-direction: column;
}

.mode-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.mode-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Cards */
.workspace-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.upload-pane {
    display: none;
}

.upload-pane.active {
    display: block;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    background-color: var(--bg-card-subtle);
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.drop-icon {
    font-size: 2.6rem;
    margin-bottom: 12px;
}

.drop-title {
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.drop-help {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.btn-browse {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-medium);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.btn-browse:hover {
    background-color: #EFEBE4;
    border-color: var(--border-hover);
}

/* Selected File Card */
.selected-file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-top: 16px;
}

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

.file-badge {
    background-color: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
}

.file-meta {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

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

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color var(--transition-fast);
}

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

/* Batch List */
.batch-list-container {
    margin-top: 16px;
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.batch-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.file-list {
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
}

.file-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.file-list-item:hover {
    background-color: #ECE7DF;
}

.file-list-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.file-list-name {
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Action Bar */
.action-bar {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    transition: all var(--transition-fast);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
    background-color: #D5CDC0;
    color: #78716C;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background-color: var(--bg-card-subtle);
    color: var(--text-main);
    border-color: var(--border-hover);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Processing Progress Section */
.processing-top {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.processing-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(37, 99, 235, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.processing-headings {
    flex: 1;
}

.processing-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-main);
}

.processing-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.processing-percentage {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background-color: var(--border-subtle);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #0284c7);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-meta-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    margin-bottom: 24px;
}

.current-stage-chip {
    font-weight: 600;
    color: var(--primary);
}

.active-engine-chip {
    color: var(--text-muted);
}

/* 10 Pipeline Stages */
.pipeline-checklist {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.stage-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.stage-step.in-progress {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.stage-step.in-progress .step-name {
    color: var(--primary);
    font-weight: 600;
}

.stage-step.completed {
    background-color: var(--success-bg);
    border-color: var(--success-border);
}

.stage-step.completed .step-num {
    background-color: var(--success);
    color: #ffffff;
}

.step-num {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    background-color: #E2DBD0;
    color: var(--text-secondary);
    padding: 2px 5px;
    border-radius: 3px;
}

.step-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Complete Section */
.complete-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.success-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.complete-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.complete-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.result-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.result-detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-val {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.text-emerald {
    color: var(--success) !important;
}

.complete-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-download {
    text-decoration: none;
    padding: 14px 28px;
    font-size: 0.95rem;
}

/* Error Banner */
.error-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-top: 20px;
}

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

.error-text {
    font-size: 0.88rem;
    color: var(--danger-text);
    font-weight: 500;
}

.btn-close-error {
    background: transparent;
    border: none;
    color: var(--danger-text);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Stats Grid (Dashboard) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 1.8rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-success {
    border-left: 4px solid var(--success);
}
.stat-processing {
    border-left: 4px solid var(--primary);
}
.stat-warn {
    border-left: 4px solid var(--warning);
}

/* Data Tables */
.panel-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.info-table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    background-color: #ECE7DF;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    letter-spacing: 0.4px;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #ECE7DF;
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background-color: #FAF8F5;
    color: var(--text-main);
}

.btn-table-action {
    display: inline-block;
    background-color: var(--primary-light);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-table-action:hover {
    background-color: var(--primary);
    color: #ffffff;
}

/* Table stage info */
.table-stage-info {
    display: flex;
    flex-direction: column;
}

.table-stage-text {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.8rem;
}

.table-stage-pct {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Badges */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.badge-processing {
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-border);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.badge-danger {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--info-border);
}

.badge-neutral {
    background-color: #ECE7DF;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

/* Rules Grid */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.rule-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.rule-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    background-color: var(--primary-light);
    border: 1px solid var(--primary-border);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.rule-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.rule-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.rule-desc code {
    background-color: #ECE7DF;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    font-size: 0.8rem;
}

/* Footer - Pinned Bottom */
.app-footer {
    height: 38px;
    flex-shrink: 0;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

/* Responsive Layout */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .rules-grid { grid-template-columns: repeat(2, 1fr); }
    .pipeline-checklist { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .app-body { flex-direction: column; }
    .app-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-subtle); }
    .mode-selector { grid-template-columns: 1fr; }
    .result-details-grid { grid-template-columns: 1fr; }
    .rules-grid { grid-template-columns: 1fr; }
    .pipeline-checklist { grid-template-columns: 1fr; }
}
