/* QAi — Smart Factory OMNIS Accelerator Design System */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e2e5ea;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eef2ff;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --radius: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.5;
    min-height: 100vh; display: flex; flex-direction: column;
}

/* Header */
header {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 24px; display: flex; align-items: center; height: 56px;
    box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand h1 { font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.brand-sub { font-size: 12px; color: var(--text-muted); font-weight: 500; }
nav { margin-left: auto; display: flex; gap: 2px; }
.nav-btn {
    background: none; border: none; padding: 6px 14px;
    border-radius: var(--radius); cursor: pointer; font-size: 13px;
    color: var(--text-muted); font-weight: 500; transition: all 0.15s;
}
.nav-btn.active, .nav-btn:hover { background: var(--primary); color: white; }

/* Footer */
footer {
    margin-top: auto; padding: 12px 24px; display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border);
    background: var(--surface);
}

main { max-width: 1200px; margin: 0 auto; padding: 24px; width: 100%; flex: 1; }

/* Breadcrumbs */
.breadcrumb {
    display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
    font-size: 13px; color: var(--text-muted);
}
.breadcrumb button {
    background: none; border: none; color: var(--primary); cursor: pointer;
    font-size: 13px; padding: 0; font-weight: 500;
}
.breadcrumb button:hover { text-decoration: underline; }
.bc-sep { color: var(--border); }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar h2, .toolbar h3 { font-size: 18px; font-weight: 700; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-back, .btn-small {
    border: none; border-radius: var(--radius); cursor: pointer;
    font-size: 13px; padding: 8px 16px; font-weight: 500; transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--bg); }
.btn-back { background: none; border: none; color: var(--primary); padding: 0; margin-bottom: 16px; cursor: pointer; }
.btn-small { padding: 4px 10px; font-size: 12px; }

/* Forms */
.form-panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.form-panel input, .form-panel textarea, .form-panel select {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 14px; margin-bottom: 8px;
    transition: border-color 0.15s;
}
.form-panel input:focus, .form-panel textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-actions { display: flex; gap: 8px; margin-top: 12px; }
.field-label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 4px; color: var(--text); }
.field-help { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.required { color: var(--danger); }
.input-group { margin-bottom: 12px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.checkbox-group label { font-size: 13px; display: flex; align-items: center; gap: 4px; cursor: pointer; }

/* Empty state */
.empty-state {
    text-align: center; padding: 48px 24px; background: var(--surface);
    border: 2px dashed var(--border); border-radius: 8px;
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; margin-bottom: 4px; }
.empty-state p { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; cursor: pointer;
    transition: all 0.15s; box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08); border-color: var(--primary); }
.card h3 { font-size: 15px; margin-bottom: 4px; font-weight: 600; }
.card p { font-size: 13px; color: var(--text-muted); }
.card .meta { font-size: 12px; color: var(--text-muted); margin-top: 10px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab-btn {
    background: none; border: none; padding: 10px 18px;
    cursor: pointer; font-size: 13px; color: var(--text-muted);
    border-bottom: 2px solid transparent; font-weight: 500; transition: all 0.15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover:not(.active) { color: var(--text); }

/* Wizard */
.wizard-panel { border: 1px solid var(--primary); border-radius: 8px; }
.wizard-header { margin-bottom: 16px; }
.wizard-header h3 { font-size: 17px; font-weight: 700; }
.wizard-tabs {
    display: flex; gap: 0; background: var(--bg); border-radius: var(--radius);
    padding: 3px; margin-bottom: 16px;
}
.wizard-tab {
    flex: 1; padding: 8px 12px; border: none; background: none;
    border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 500;
    color: var(--text-muted); transition: all 0.15s; text-align: center;
}
.wizard-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.wizard-tab:hover:not(.active) { color: var(--text); }
.wizard-tab-content { min-height: 100px; }
.wizard-footer { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px; }
.wizard-input-summary {
    font-size: 12px; color: var(--text-muted); margin-bottom: 8px;
    display: flex; gap: 12px; flex-wrap: wrap;
}
.wizard-input-summary .input-indicator {
    display: inline-flex; align-items: center; gap: 4px;
}
.wizard-input-summary .input-indicator.has-data { color: var(--success); font-weight: 500; }

/* Tables */
.data-table {
    width: 100%; border-collapse: collapse; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px;
}
.data-table th {
    text-align: left; padding: 10px 12px; background: var(--bg);
    border-bottom: 1px solid var(--border); font-weight: 600; font-size: 12px;
    text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.3px;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.data-table tr:last-child td { border-bottom: none; }

/* Status badges */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.badge-pass { background: #dcfce7; color: var(--success); }
.badge-fail { background: #fef2f2; color: var(--danger); }
.badge-needs_review, .badge-needs-review { background: #fef3c7; color: var(--warning); }
.badge-blocked { background: #f3f4f6; color: #6b7280; }
.badge-pending { background: #f0f9ff; color: var(--info); }
.badge-skipped { background: #f3f4f6; color: #9ca3af; }
.badge-error { background: #fef2f2; color: var(--danger); }
.badge-active { background: #dcfce7; color: var(--success); }
.badge-api-test { background: #dbeafe; color: #1d4ed8; }
.badge-data-validation { background: #faf5ff; color: #7c3aed; }
.badge-manual { background: #fef3c7; color: var(--warning); }
.badge-critical { background: #fef2f2; color: var(--danger); }
.badge-high { background: #fff7ed; color: #ea580c; }
.badge-medium { background: #fefce8; color: #a16207; }
.badge-low { background: #f0fdf4; color: #15803d; }

/* Summary bar */
.summary-bar {
    display: flex; gap: 16px; padding: 14px 20px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.summary-item { text-align: center; min-width: 60px; }
.summary-item .count { font-size: 24px; font-weight: 700; }
.summary-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

/* Coverage bar */
.coverage-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin: 4px 0; }
.coverage-fill { height: 100%; background: var(--success); border-radius: 4px; transition: width 0.3s; }

/* Lists */
.item-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px;
    box-shadow: var(--shadow-sm); transition: border-color 0.15s;
}
.item-row:hover { border-color: var(--primary); }
.item-row .title { font-weight: 500; font-size: 14px; }
.item-row .meta { font-size: 12px; color: var(--text-muted); }

/* Inline form */
.inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-form input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.inline-form select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }

/* Objectives */
.objectives-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 4px; }
.objective-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary-light); color: #3b5bdb; border: 1px solid #c3d0f5;
    border-radius: 16px; padding: 4px 12px; font-size: 12px; font-weight: 500;
}
.objective-tag .remove {
    cursor: pointer; font-size: 14px; line-height: 1; color: #6b7fb8;
    border: none; background: none; padding: 0;
}
.objective-tag .remove:hover { color: var(--danger); }
.objective-presets { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.preset-chip {
    background: var(--bg); border: 1px dashed var(--border); border-radius: 12px;
    padding: 3px 10px; font-size: 11px; cursor: pointer; color: var(--text-muted); transition: all 0.15s;
}
.preset-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* Filter */
.filter-select {
    padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 12px; background: var(--surface);
}

/* Result cards */
.result-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 6px; overflow: hidden; transition: all 0.15s; box-shadow: var(--shadow-sm);
}
.result-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.result-card-header { display: flex; align-items: center; padding: 10px 14px; gap: 12px; cursor: pointer; }
.result-card-header .rc-status { flex-shrink: 0; width: 70px; text-align: center; }
.result-card-header .rc-title { flex: 1; }
.result-card-header .rc-title strong { font-size: 13px; display: block; }
.result-card-header .rc-title .rc-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.result-card-header .rc-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.result-card-header .rc-actions { display: flex; gap: 4px; flex-shrink: 0; }
.result-card-detail { display: none; padding: 0 14px 14px; border-top: 1px solid #f0f0f0; }
.result-card.expanded .result-card-detail { display: block; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.detail-section h4 { font-size: 12px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; letter-spacing: 0.3px; }
.detail-section p, .detail-section pre { font-size: 13px; margin: 0; }
.detail-section pre {
    background: #f8f9fa; padding: 8px; border-radius: 4px; font-size: 12px;
    overflow-x: auto; white-space: pre-wrap; word-break: break-word; max-height: 200px;
}
.result-card.status-pass { border-left: 3px solid var(--success); }
.result-card.status-fail { border-left: 3px solid var(--danger); }
.result-card.status-needs-review { border-left: 3px solid var(--warning); }
.result-card.status-error { border-left: 3px solid var(--danger); }
.result-card.status-blocked { border-left: 3px solid #9ca3af; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-content {
    background: var(--surface); border-radius: 8px; width: 100%; max-width: 800px;
    max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
    background: var(--surface); z-index: 1;
}
.modal-header h3 { font-size: 16px; margin: 0; }
#detail-body { padding: 20px; }

/* Framework cards */
.fw-category { margin-bottom: 16px; }
.fw-category-label { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.fw-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.fw-card {
    display: grid; grid-template-columns: 18px 1fr; gap: 8px;
    padding: 10px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer; transition: all 0.15s;
    background: var(--surface); align-items: start;
}
.fw-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.fw-card:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.fw-card input[type="checkbox"] { margin-top: 2px; accent-color: var(--primary); }
.fw-card-body { overflow: hidden; }
.fw-card-title { font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.fw-card-version { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.fw-card-desc {
    font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.fw-card-link {
    font-size: 11px; color: var(--primary); text-decoration: none;
    display: inline-block; margin-top: 4px;
}
.fw-card-link:hover { text-decoration: underline; }

/* Upload controls */
.upload-bar {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: #f0f7ff; border: 1px dashed #93b8e8; border-radius: var(--radius);
    margin-bottom: 10px;
}
.upload-btn { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.upload-btn:hover { border-color: var(--primary); }
.field-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.upload-btn-inline {
    font-size: 11px; color: var(--primary); cursor: pointer;
    display: inline-flex; align-items: center; gap: 2px;
}
.upload-btn-inline:hover { text-decoration: underline; }

/* Workflow pipeline */
.pipeline {
    display: flex; align-items: center; gap: 0; padding: 12px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-x: auto;
}
.pipeline-stage {
    flex: 1; text-align: center; padding: 10px 8px;
    border-radius: var(--radius); min-width: 100px;
}
.pipeline-stage.stage-completed { background: #dcfce7; }
.pipeline-stage.stage-active { background: var(--primary-light); border: 1px solid var(--primary); }
.pipeline-stage.stage-pending { background: var(--bg); color: var(--text-muted); }
.stage-name { font-size: 13px; font-weight: 600; }
.stage-status { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.pipeline-arrow { color: var(--border); font-size: 11px; padding: 0 4px; flex-shrink: 0; }

/* Login */
.login-container {
    max-width: 400px; margin: 60px auto; background: var(--surface);
    padding: 32px; border-radius: 8px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.login-container h2 { margin-bottom: 4px; }
.login-input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 14px; margin-bottom: 12px;
}
.login-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Steps list */
.steps-list { padding-left: 20px; margin: 6px 0; }
.steps-list li { margin-bottom: 6px; font-size: 13px; }
.step-action { font-weight: 500; }
.step-expected { color: var(--text-muted); font-size: 12px; margin-left: 4px; }

/* ======== OMNIS back-link ======== */
.omnis-link {
    font-size: 12px; color: var(--text-muted); font-weight: 500;
    text-decoration: none; margin-right: 12px; border-right: 1px solid var(--border);
    padding-right: 12px; white-space: nowrap; transition: color 0.15s;
}
.omnis-link:hover { color: var(--primary); }

/* ======== Toast notifications ======== */
#toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
    padding: 12px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15); max-width: 360px; pointer-events: auto;
    animation: toast-in 0.2s ease; display: flex; align-items: flex-start; gap: 10px;
}
.toast-success { background: #dcfce7; color: #15803d; border-left: 3px solid var(--success); }
.toast-error   { background: #fef2f2; color: var(--danger); border-left: 3px solid var(--danger); }
.toast-warning { background: #fef3c7; color: var(--warning); border-left: 3px solid var(--warning); }
.toast-info    { background: #f0f9ff; color: var(--info); border-left: 3px solid var(--info); }
.toast-close   { margin-left: auto; cursor: pointer; font-size: 16px; opacity: 0.6; background: none; border: none; color: inherit; flex-shrink: 0; }
.toast-close:hover { opacity: 1; }
@keyframes toast-in { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }

/* ======== Welcome / onboarding panel ======== */
.welcome-panel {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    color: white; border-radius: 10px; padding: 28px 32px; margin-bottom: 20px;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
    box-shadow: 0 4px 20px rgba(37,99,235,0.3);
}
.welcome-panel h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.welcome-panel p  { font-size: 14px; opacity: 0.9; line-height: 1.6; max-width: 600px; }
.welcome-steps {
    display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.welcome-step {
    background: rgba(255,255,255,0.15); border-radius: 20px;
    padding: 5px 14px; font-size: 12px; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
}
.welcome-step-num {
    background: white; color: var(--primary); border-radius: 50%;
    width: 18px; height: 18px; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.welcome-dismiss {
    background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4);
    color: white; border-radius: var(--radius); padding: 6px 14px;
    font-size: 12px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
    transition: background 0.15s;
}
.welcome-dismiss:hover { background: rgba(255,255,255,0.3); }

/* ======== Health score (dashboard project cards) ======== */
.project-health-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
    cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow-sm);
    display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 10px;
}
.project-health-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08); border-color: var(--primary); }
.project-health-card .phc-name { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.project-health-card .phc-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.phc-action-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.action-pill {
    display: inline-flex; align-items: center; gap: 4px;
    border-radius: 12px; padding: 2px 10px; font-size: 11px; font-weight: 600;
}
.action-pill-crit  { background: #fef2f2; color: var(--danger); }
.action-pill-review{ background: #fef3c7; color: var(--warning); }
.action-pill-manual{ background: #f0f9ff; color: var(--info); }
.action-pill-ok    { background: #dcfce7; color: var(--success); }
.health-score-ring {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 72px; flex-shrink: 0;
}
.health-score-num  { font-size: 26px; font-weight: 800; line-height: 1; }
.health-score-label{ font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.health-green { color: var(--success); }
.health-yellow { color: var(--warning); }
.health-red    { color: var(--danger); }
.health-neutral{ color: var(--text-muted); }

/* ======== Portfolio summary bar (dashboard) ======== */
.portfolio-bar {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px;
    background: var(--border); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.portfolio-stat {
    background: var(--surface); padding: 14px 16px; text-align: center;
}
.portfolio-stat .pstat-num  { font-size: 22px; font-weight: 700; }
.portfolio-stat .pstat-label{ font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }

/* ======== Manual Test Runner ======== */
.runner-layout {
    display: grid; grid-template-columns: 280px 1fr; gap: 16px;
    height: calc(100vh - 140px); min-height: 400px;
}
.runner-queue {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
}
.runner-queue-header {
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 13px; background: var(--bg);
    display: flex; justify-content: space-between; align-items: center;
}
.runner-queue-list { overflow-y: auto; flex: 1; }
.runner-queue-item {
    padding: 10px 14px; border-bottom: 1px solid #f0f0f0;
    cursor: pointer; transition: background 0.1s; font-size: 13px;
}
.runner-queue-item:hover { background: var(--bg); }
.runner-queue-item.rqi-active { background: var(--primary-light); border-left: 3px solid var(--primary); }
.runner-queue-item.rqi-done   { opacity: 0.5; }
.rqi-title { font-weight: 500; margin-bottom: 2px; }
.rqi-meta  { font-size: 11px; color: var(--text-muted); }
.runner-main {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
}
.runner-main-header {
    padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--bg);
    display: flex; justify-content: space-between; align-items: center;
}
.runner-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.runner-progress-bar { height: 6px; background: #e5e7eb; border-radius: 3px; width: 120px; overflow: hidden; }
.runner-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }
.runner-timer { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.runner-content { padding: 20px; overflow-y: auto; flex: 1; }
.runner-test-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.runner-test-meta  { display: flex; gap: 8px; margin-bottom: 14px; }
.runner-section { margin-bottom: 16px; }
.runner-section-label {
    font-size: 11px; text-transform: uppercase; color: var(--text-muted);
    letter-spacing: 0.3px; font-weight: 600; margin-bottom: 6px;
}
.runner-step {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 6px; background: var(--bg);
}
.runner-step-num {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
    background: var(--border); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.runner-step-body { flex: 1; }
.runner-step-action   { font-size: 13px; font-weight: 500; }
.runner-step-expected { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.runner-actions {
    padding: 16px 20px; border-top: 1px solid var(--border);
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    background: var(--bg);
}
.runner-btn-pass  { background: var(--success); color: white; border: none; border-radius: var(--radius); padding: 10px 22px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.runner-btn-fail  { background: var(--danger);  color: white; border: none; border-radius: var(--radius); padding: 10px 22px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.runner-btn-block { background: #6b7280; color: white; border: none; border-radius: var(--radius); padding: 10px 22px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.runner-btn-skip  { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: var(--radius); padding: 10px 18px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.runner-btn-pass:hover { opacity: 0.85; } .runner-btn-fail:hover { opacity: 0.85; } .runner-btn-block:hover { opacity: 0.85; }
.runner-btn-skip:hover { border-color: var(--primary); color: var(--primary); }
.runner-notes {
    flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 13px; resize: none;
}
.runner-notes:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.runner-kbd { font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-family: monospace; }
.runner-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); text-align: center; padding: 40px;
}
.runner-empty h3 { font-size: 16px; margin-bottom: 8px; }
.runner-all-done {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; padding: 40px; text-align: center;
}
.runner-all-done .done-icon { font-size: 48px; margin-bottom: 12px; }
.runner-all-done h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.runner-all-done p  { color: var(--text-muted); font-size: 14px; }

/* ======== Test Case Cards (suite view editor) ======== */
.tc-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 6px; background: var(--surface); box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.tc-header {
    display: flex; align-items: center; padding: 8px 12px; gap: 10px;
    cursor: pointer; transition: background 0.1s;
}
.tc-header:hover { background: var(--bg); }
.tc-title  { font-size: 13px; font-weight: 500; flex: 1; }
.tc-badges { display: flex; gap: 4px; flex-shrink: 0; }
.tc-btns   { display: flex; gap: 4px; margin-left: 4px; flex-shrink: 0; }
.tc-editor {
    padding: 14px 16px; border-top: 1px solid var(--border); background: var(--bg);
}
.tc-field-label {
    font-size: 12px; font-weight: 600; display: block;
    margin-bottom: 3px; color: var(--text);
}
.tc-editor input, .tc-editor textarea, .tc-editor select {
    width: 100%; padding: 6px 10px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 13px; margin-bottom: 10px;
    font-family: inherit; background: var(--surface);
}
.tc-editor input:focus, .tc-editor textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.tc-editor textarea { resize: vertical; min-height: 56px; }
.tc-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tc-steps-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px;
}
.tc-step-row {
    display: flex; gap: 6px; align-items: flex-start; margin-bottom: 6px;
}
.tc-step-num {
    width: 22px; height: 22px; border-radius: 50%; background: var(--border);
    color: var(--text-muted); font-size: 11px; font-weight: 700; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; margin-top: 6px;
}
.tc-step-inputs { flex: 1; display: flex; gap: 6px; }
.tc-step-inputs input { margin: 0; flex: 1; }
.tc-step-del {
    color: var(--danger); background: none; border: none; cursor: pointer;
    font-size: 16px; padding: 0 4px; flex-shrink: 0; margin-top: 4px;
}
.tc-step-del:hover { opacity: 0.7; }
.tc-ai-btn {
    background: var(--primary-light); color: var(--primary);
    border: 1px solid #c3d0f5; border-radius: var(--radius);
    padding: 6px 14px; font-size: 12px; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: 12px; transition: all 0.15s;
}
.tc-ai-btn:hover  { background: var(--primary); color: white; }
.tc-ai-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.tc-editor-footer {
    display: flex; gap: 8px; margin-top: 4px; border-top: 1px solid var(--border); padding-top: 12px;
}
/* New case creation panel */
.new-case-panel {
    background: var(--surface); border: 1px solid var(--primary);
    border-radius: var(--radius); padding: 16px; margin-top: 8px;
    box-shadow: var(--shadow-sm);
}

/* ======== Test Plan cards (list view) ======== */
.plan-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
    margin-bottom: 8px; box-shadow: var(--shadow-sm);
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    transition: border-color 0.15s;
}
.plan-card:hover { border-color: var(--primary); }
.plan-card-passed  { border-left: 4px solid var(--success); }
.plan-card-issues  { border-left: 4px solid var(--danger); }
.plan-card-pending { border-left: 4px solid var(--warning); }
.plan-card-untested{ border-left: 4px solid var(--border); }
.plan-card-info { flex: 1; }
.plan-card-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.plan-card-meta  { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.plan-run-summary {
    display: flex; align-items: center; gap: 10px; font-size: 12px; flex-wrap: wrap;
}
.plan-run-bar {
    display: flex; height: 6px; border-radius: 3px; overflow: hidden;
    width: 120px; flex-shrink: 0; background: var(--border);
}
.plan-run-bar-pass    { background: var(--success); }
.plan-run-bar-fail    { background: var(--danger); }
.plan-run-bar-review  { background: var(--warning); }
.plan-run-bar-pending { background: #d1d5db; }
.plan-card-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.plan-never-run { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* ======== Workflow template picker ======== */
.workflow-template-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px;
}
.wf-template-btn {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 14px; text-align: left; cursor: pointer; transition: all 0.15s;
    box-shadow: var(--shadow-sm);
}
.wf-template-btn:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,0.1); background: var(--primary-light); }
.wf-tpl-name  { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.wf-tpl-desc  { font-size: 11px; color: var(--text-muted); line-height: 1.5; margin-bottom: 6px; }
.wf-tpl-tag   { font-size: 10px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.4px; }
.pipeline-arrow { color: var(--text-muted); font-size: 14px; padding: 0 6px; flex-shrink: 0; align-self: center; }
.workflow-lock-notice {
    font-size: 11px; color: var(--text-muted); margin-top: 6px;
    padding: 4px 8px; display: flex; align-items: center; gap: 4px;
}

/* Framework recommendation dimming */
.fw-card.fw-recommended { border-color: var(--primary); background: var(--primary-light); }
.fw-card.fw-dim { opacity: 0.45; }
.fw-recommend-badge {
    font-size: 10px; font-weight: 700; color: var(--primary);
    text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px;
}
