.test-dashboard { max-width: 1200px; margin: 0 auto; }
.test-card {
    background: #fff; border-radius: 12px; padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1); margin-bottom: 20px;
}
.test-card h3 { margin: 0; font-size: 1rem; color: #374151; }

.test-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.test-header h1 { margin: 0; font-size: 1.5rem; }
.last-updated { font-size: 0.8rem; color: #9ca3af; margin-left: 12px; }

.run-btn {
    background: #3b82f6; color: #fff; border: none; padding: 8px 20px;
    border-radius: 8px; cursor: pointer; font-size: 0.875rem;
}
.run-btn:hover { background: #2563eb; }
.run-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Summary */
.summary-card.passed { border-left: 4px solid #10b981; }
.summary-card.failed { border-left: 4px solid #ef4444; }

.summary-row { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; padding: 8px 0; }
.summary-item { text-align: center; min-width: 80px; }
.summary-label { font-size: 0.8rem; color: #6b7280; margin-bottom: 4px; }
.summary-value { font-size: 1.75rem; font-weight: 700; color: #111827; }
.summary-pass { color: #10b981; }
.summary-fail { color: #ef4444; }
.summary-error { color: #f59e0b; }
.summary-skip { color: #6b7280; }

/* Progress bar */
.progress-bar-wrap {
    width: 100%; height: 12px; background: #e5e7eb; border-radius: 6px;
    overflow: hidden; display: flex;
}
.progress-bar-fill { height: 100%; transition: width .6s ease; }
.bar-pass { background: #10b981; }
.bar-fail { background: #ef4444; }
.bar-error { background: #f59e0b; }
.bar-skip { background: #d1d5db; }

/* Status badge */
.status-badge {
    display: inline-block; padding: 2px 10px; border-radius: 9999px;
    font-size: 0.75rem; font-weight: 600;
}
.status-ok { background: #d1fae5; color: #065f46; }
.status-fail { background: #fee2e2; color: #991b1b; }

/* Card header */
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* Output */
.test-output-wrap { margin-top: 8px; }
.toggle-output {
    background: none; border: 1px solid #d1d5db; padding: 4px 12px;
    border-radius: 6px; cursor: pointer; font-size: 0.8rem; color: #6b7280;
}
.toggle-output:hover { background: #f9fafb; }
.copy-btn {
    background: none; border: 1px solid #d1d5db; padding: 4px 12px;
    border-radius: 6px; cursor: pointer; font-size: 0.8rem; color: #6b7280;
    margin-left: 4px; transition: all .2s;
}
.copy-btn:hover { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.copy-btn.copied { background: #d1fae5; border-color: #10b981; color: #065f46; }
.test-output {
    background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: 8px;
    font-size: 0.8rem; line-height: 1.6; overflow-x: auto; margin-top: 8px;
    max-height: 600px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}

/* Spinner */
.spinner {
    width: 40px; height: 40px; border: 4px solid #e5e7eb; border-top-color: #3b82f6;
    border-radius: 50%; animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* AI Fix */
.card-header-actions { display: flex; align-items: center; gap: 8px; }
.ai-fix-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; border: none;
    padding: 6px 16px; border-radius: 8px; cursor: pointer; font-size: 0.8rem; font-weight: 600;
}
.ai-fix-btn:hover { background: linear-gradient(135deg, #7c3aed, #5b21b6); }
.ai-fix-btn:disabled { opacity: .5; cursor: not-allowed; }
.ai-fix-content {
    background: #faf5ff; border: 1px solid #e9d5ff; border-radius: 8px;
    padding: 20px; margin-top: 12px; font-size: 0.875rem; line-height: 1.8; color: #1e1b4b;
}
.ai-heading { font-size: 1rem; font-weight: 700; color: #6d28d9; margin: 16px 0 8px; }
.ai-subheading { font-size: 0.9rem; font-weight: 600; color: #7c3aed; margin: 12px 0 6px; }
.ai-code-block {
    background: #1e293b; color: #e2e8f0; padding: 12px; border-radius: 6px;
    font-size: 0.8rem; overflow-x: auto; margin: 8px 0; display: block; white-space: pre-wrap;
}
.ai-inline-code {
    background: #ede9fe; color: #5b21b6; padding: 1px 6px; border-radius: 4px; font-size: 0.8rem;
}

/* Streaming progress panel */
.progress-panel { border-left: 4px solid #3b82f6; }
.progress-header { margin-bottom: 12px; }
.progress-stats-row {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
}
.progress-stats { font-size: 0.9rem; font-weight: 600; color: #374151; }
.progress-eta { font-size: 0.8rem; color: #6b7280; }
.progress-pct {
    text-align: right; font-size: 0.75rem; color: #6b7280; margin-top: 4px;
}
.progress-bar-stream-wrap {
    width: 100%; height: 10px; background: #e5e7eb; border-radius: 5px;
    overflow: hidden;
}
.progress-bar-stream {
    height: 100%; background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 5px; transition: width .3s ease;
}
.progress-bar-stream.has-failures {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.progress-log {
    background: #0f172a; color: #e2e8f0; border-radius: 8px;
    padding: 12px 16px; font-size: 0.8rem; line-height: 1.7;
    max-height: 400px; overflow-y: auto; font-family: monospace;
}
.progress-log .log-pass { color: #34d399; }
.progress-log .log-fail { color: #f87171; }
.progress-log .log-info { color: #93c5fd; }

/* History table */
.history-table-wrap { overflow-x: auto; }
.history-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.history-table th {
    text-align: left; padding: 8px 10px; border-bottom: 2px solid #e5e7eb;
    color: #6b7280; font-weight: 600; font-size: 0.8rem; white-space: nowrap;
}
.history-table td {
    padding: 8px 10px; border-bottom: 1px solid #f3f4f6; white-space: nowrap;
}
.history-table tbody tr:hover { background: #f9fafb; }
.history-output-row td { white-space: normal; padding: 0; }
.history-output-row .test-output { margin: 0 10px 8px; max-height: 400px; }
.history-output-actions { padding: 8px 10px 0; text-align: right; }
