@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #4318D1; --primary-light: #6B4DE6; --primary-dark: #3210A3;
  --primary-bg: #F4F1FE; --primary-bg-subtle: #F9F8FF;
  --teal: #0EA5A0; --purple: #7C3AED; --green: #10B981;
  --coral: #F43F5E; --orange: #F97316; --blue: #3B82F6;
  --text-primary: #1A1A2E; --text-secondary: #6B7280; --text-tertiary: #9CA3AF;
  --border: #E5E7EB; --border-light: #F3F4F6;
  --bg-white: #FFFFFF; --bg-page: #FAFBFD;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-card-hover: 0 8px 25px rgba(67,24,209,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 9999px;
  --transition: all 0.2s ease; --nav-h: 64px;
}
body { font-family: 'Poppins', -apple-system, sans-serif; background: var(--bg-page); color: var(--text-primary); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* NAV */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h); background: var(--bg-white); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-logo { width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.nav-logo svg { width: 20px; height: 20px; }
.nav-brand-text h1 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.nav-brand-text span { font-size: 11px; color: var(--text-tertiary); font-weight: 400; }
.nav-links { display: flex; gap: 4px; }
.nav-link { padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none; border-radius: var(--r-sm); transition: var(--transition); }
.nav-link:hover { color: var(--text-primary); background: var(--border-light); }
.nav-link.active { color: var(--primary); background: var(--primary-bg); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.btn-icon { position: relative; background: none; border: none; cursor: pointer; padding: 8px; border-radius: var(--r-sm); color: var(--text-secondary); }
.btn-icon:hover { background: var(--border-light); }
.notif-badge { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; background: var(--coral); color: white; font-size: 10px; font-weight: 600; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.avatar { width: 32px; height: 32px; background: linear-gradient(135deg, var(--primary), var(--teal)); color: white; font-size: 12px; font-weight: 600; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* LAYOUT */
.app-container { padding-top: var(--nav-h); }
.main-content { max-width: 1280px; margin: 0 auto; padding: 24px 32px; }
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.hidden { display: none !important; }

/* HERO */
.hero { background: linear-gradient(135deg, #2D1B69 0%, #4318D1 50%, #6B4DE6 100%); border-radius: var(--r-xl); padding: 32px 40px; margin-bottom: 24px; color: white; }
.hero-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; opacity: 0.85; margin-bottom: 8px; }
.hero-status-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; display: inline-block; }
.hero-status-dot.dot-orange { background: var(--orange); }
.hero-title { font-size: 28px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.02em; }
.hero-subtitle { font-size: 14px; opacity: 0.8; max-width: 600px; }
.hero-ctas { margin-top: 16px; display: flex; gap: 12px; align-items: center; }

/* CARDS */
.card { background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-card); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-wide { grid-column: 1 / -1; }

/* STATS */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 20px 24px; box-shadow: var(--shadow-card); }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.stat-delta { font-size: 12px; margin-top: 4px; font-weight: 500; }
.stat-delta.positive { color: var(--green); }
.stat-delta.neutral { color: var(--text-secondary); }
.stat-delta.negative { color: var(--coral); }

/* DASHBOARD GRID */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* PIPELINE VISUAL */
.pipeline-visual { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.pipeline-stage { flex: 1; }
.pipeline-stage-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pipeline-stage-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.pipeline-stage-count { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.pipeline-bar { height: 8px; background: var(--border-light); border-radius: var(--r-full); overflow: hidden; }
.pipeline-fill { height: 100%; background: var(--primary); border-radius: var(--r-full); transition: width 0.6s ease; }
.pipeline-fill.fill-teal { background: var(--teal); }
.pipeline-fill.fill-purple { background: var(--purple); }
.pipeline-fill.fill-orange { background: var(--orange); }
.pipeline-fill.fill-green { background: var(--green); }
.pipeline-arrow { color: var(--text-tertiary); font-size: 16px; flex-shrink: 0; }

/* RUN LIST ITEMS */
.run-item { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.run-item:last-child { border-bottom: none; }
.run-icon { width: 40px; height: 40px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.run-icon.seq { background: #EDE9FE; }
.run-icon.analyze { background: #D1FAE5; }
.run-icon.qc { background: #FEF3C7; }
.run-icon.done { background: #DBEAFE; }
.run-info { flex: 1; min-width: 0; }
.run-info-title { font-size: 13px; font-weight: 600; }
.run-info-meta { font-size: 12px; color: var(--text-secondary); }
.run-progress { width: 80px; }
.run-progress-bar { height: 6px; background: var(--border-light); border-radius: var(--r-full); overflow: hidden; }
.run-progress-fill { height: 100%; border-radius: var(--r-full); }

/* EXCEPTION LIST */
.exception-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.exception-item:last-child { border-bottom: none; }
.exception-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.exception-dot.warn { background: var(--orange); }
.exception-dot.error { background: var(--coral); }
.exception-info { flex: 1; }
.exception-info-title { font-size: 13px; font-weight: 600; }
.exception-info-detail { font-size: 12px; color: var(--text-secondary); }

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.data-table td { font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--primary-bg-subtle); }

/* BADGES */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; font-size: 11px; font-weight: 600; border-radius: var(--r-full); }
.badge-info { background: #DBEAFE; color: #1D4ED8; }
.badge-success { background: #D1FAE5; color: #047857; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-error { background: #FEE2E2; color: #DC2626; }
.badge-published { background: #D1FAE5; color: #047857; }
.badge-draft { background: #FEF3C7; color: #B45309; }

/* BUTTONS */
.btn-primary { background: var(--primary); color: white; border: none; padding: 10px 20px; font-size: 13px; font-weight: 600; border-radius: var(--r-sm); cursor: pointer; font-family: inherit; transition: var(--transition); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--bg-white); color: var(--text-primary); border: 1px solid var(--border); padding: 10px 20px; font-size: 13px; font-weight: 500; border-radius: var(--r-sm); cursor: pointer; font-family: inherit; transition: var(--transition); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-success { background: var(--green); color: white; border: none; padding: 6px 14px; font-size: 12px; font-weight: 600; border-radius: var(--r-sm); cursor: pointer; font-family: inherit; }
.btn-warning { background: var(--orange); color: white; border: none; padding: 6px 14px; font-size: 12px; font-weight: 600; border-radius: var(--r-sm); cursor: pointer; font-family: inherit; }
.btn-danger { background: var(--coral); color: white; border: none; padding: 6px 14px; font-size: 12px; font-weight: 600; border-radius: var(--r-sm); cursor: pointer; font-family: inherit; }
.link-subtle { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 500; }
.link-subtle:hover { text-decoration: underline; }
.text-muted { font-size: 12px; color: var(--text-tertiary); }

/* RUN PLANNING */
.run-planning-layout { display: flex; flex-direction: column; gap: 16px; }
.rp-step-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.rp-step-num { width: 32px; height: 32px; background: var(--primary); color: white; font-size: 14px; font-weight: 700; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rp-step-header h3 { font-size: 16px; font-weight: 600; }
.assay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.assay-card { background: var(--bg-white); border: 2px solid var(--border-light); border-radius: var(--r-md); padding: 20px; cursor: pointer; transition: var(--transition); }
.assay-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.assay-card.selected { border-color: var(--primary); background: var(--primary-bg); }
.assay-card-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.assay-card-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.assay-card-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.assay-tag { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-full); background: var(--border-light); color: var(--text-secondary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; font-size: 13px; font-family: inherit; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-white); transition: var(--transition); }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,24,209,0.1); }
.sample-section { margin-top: 16px; }
.sample-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sample-section-header h4 { font-size: 14px; font-weight: 600; }
.sample-actions { display: flex; gap: 8px; }
.batching-hint { margin-top: 12px; padding: 12px 16px; background: #EDE9FE; border-radius: var(--r-sm); font-size: 12px; color: var(--primary-dark); }
.rp-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.validation-results { margin-bottom: 20px; }
.validation-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.validation-icon { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.validation-icon.pass { background: #D1FAE5; color: var(--green); }
.validation-icon.fail { background: #FEE2E2; color: var(--coral); }
.sample-sheet-preview { background: #F9FAFB; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 16px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 11px; line-height: 1.6; white-space: pre; overflow-x: auto; max-height: 240px; }

/* MONITORING */
.monitoring-list { display: flex; flex-direction: column; gap: 16px; }
.monitor-card { background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-card); }
.monitor-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.monitor-header h3 { font-size: 15px; font-weight: 600; }
.monitor-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.monitor-stages { display: flex; gap: 4px; align-items: center; margin-top: 12px; }
.monitor-stage { flex: 1; text-align: center; padding: 10px 8px; border-radius: var(--r-sm); font-size: 11px; font-weight: 600; }
.monitor-stage.complete { background: #D1FAE5; color: #047857; }
.monitor-stage.active { background: #DBEAFE; color: #1D4ED8; animation: pulse 2s infinite; }
.monitor-stage.pending { background: var(--border-light); color: var(--text-tertiary); }
.monitor-stage-arrow { color: var(--text-tertiary); font-size: 14px; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.monitor-samples { margin-top: 16px; font-size: 12px; color: var(--text-secondary); }
.monitor-progress { margin-top: 12px; }
.monitor-progress-bar { height: 8px; background: var(--border-light); border-radius: var(--r-full); overflow: hidden; }
.monitor-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: var(--r-full); transition: width 0.6s ease; }
.monitor-progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* QC REVIEW */
.qc-filters { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-pill { padding: 6px 16px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--bg-white); cursor: pointer; font-family: inherit; transition: var(--transition); }
.filter-pill:hover { border-color: var(--primary); color: var(--primary); }
.filter-pill.active { background: var(--primary); color: white; border-color: var(--primary); }
.qc-list { display: flex; flex-direction: column; gap: 12px; }
.qc-card { background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-card); }
.qc-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.qc-card-title { font-size: 14px; font-weight: 600; }
.qc-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.qc-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.qc-metric { background: var(--bg-page); border-radius: var(--r-sm); padding: 12px; }
.qc-metric-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.qc-metric-value { font-size: 16px; font-weight: 700; margin-top: 2px; }
.qc-metric-value.fail { color: var(--coral); }
.qc-metric-value.pass { color: var(--green); }
.qc-metric-threshold { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }
.qc-recommendation { background: #FFF7ED; border: 1px solid #FED7AA; border-radius: var(--r-sm); padding: 12px 16px; font-size: 12px; color: #92400E; margin-bottom: 16px; }
.qc-actions { display: flex; gap: 8px; }

/* TABS */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.tab { padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--text-secondary); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: inherit; transition: var(--transition); }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* WORKFLOW GRID */
.workflow-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.workflow-card { background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-card); cursor: pointer; transition: var(--transition); }
.workflow-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.wf-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.wf-card-title { font-size: 14px; font-weight: 600; }
.wf-card-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.wf-card-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wf-step-tag { font-size: 10px; font-weight: 500; padding: 3px 10px; border-radius: var(--r-full); background: var(--primary-bg); color: var(--primary); }
.wf-card-footer { display: flex; gap: 16px; font-size: 11px; color: var(--text-tertiary); }

/* WORKFLOW DETAIL */
.wf-detail-content { display: flex; flex-direction: column; gap: 16px; }
.wf-step-card { background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--r-lg); padding: 20px 24px; box-shadow: var(--shadow-card); }
.wf-step-card-header { display: flex; align-items: center; gap: 12px; }
.wf-step-num { width: 28px; height: 28px; background: var(--primary-bg); color: var(--primary); font-size: 12px; font-weight: 700; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wf-step-card-title { font-size: 14px; font-weight: 600; }
.wf-step-card-desc { font-size: 12px; color: var(--text-secondary); margin-top: 8px; margin-left: 40px; }
.wf-step-connector { display: flex; justify-content: center; padding: 4px 0; color: var(--text-tertiary); font-size: 18px; }
.wf-detail-actions { display: flex; gap: 12px; margin-top: 8px; }

/* TOAST */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text-primary); color: white; padding: 12px 20px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease; }
.toast.success { background: var(--green); }
.toast.error { background: var(--coral); }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 150; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--bg-white); border-radius: var(--r-xl); padding: 32px; max-width: 480px; width: 90%; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.modal p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
