/* ==========================================
   E2E RUNS (nightly Cucumber jobs) — page and run viewer
   ========================================== */
.e2e-header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.e2e-nightly-status { font-size: 12px; color: var(--text-muted); }
.e2e-product { margin-bottom: 20px; }
.e2e-muted { color: var(--text-muted); font-weight: 400; }
.e2e-empty { padding: 18px 4px 6px; color: var(--text-secondary); font-size: 13px; }

.e2e-table td { vertical-align: middle; font-variant-numeric: tabular-nums; }
.e2e-row { cursor: pointer; }
.e2e-row:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.e2e-actions { text-align: right; white-space: nowrap; }
.e2e-actions .e2e-link { margin-right: 10px; }
.e2e-table td, .e2e-table th { white-space: nowrap; }
.e2e-job, .e2e-branch {
  white-space: nowrap;
  font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); border-radius: 6px; padding: 2px 7px;
}
.e2e-link { color: #a5b4fc; text-decoration: none; }
.e2e-link:hover { text-decoration: underline; }

.e2e-status {
  display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; background: rgba(100, 116, 139, 0.2); color: var(--text-secondary);
}
.e2e-status-passed { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.e2e-status-failed { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.e2e-status-flaky { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.e2e-status-no-result, .e2e-status-no-report, .e2e-status-canceled { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.e2e-counts { display: inline-flex; gap: 4px; }
.e2e-legend { display: inline-flex; gap: 4px; margin-left: 6px; }
.e2e-legend i { font-style: normal; min-width: 34px; text-align: center; font-size: 10px; color: var(--text-muted); }
.e2e-legend i.ok { color: #34d399; }
.e2e-legend i.bad { color: #f87171; }
.e2e-legend i.warn { color: #fbbf24; }
.e2e-c {
  min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, 0.04); color: var(--text-muted);
}
.e2e-c-passed { color: #34d399; }
.e2e-c-failed.on { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.e2e-c-flaky.on { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }

/* Run viewer: a near full-screen modal, the report gets the room */
.modal.e2e-run-modal {
  max-width: min(1400px, 96vw); height: 92vh; display: flex; flex-direction: column;
}
.e2e-run-modal .modal-header { gap: 16px; }
.e2e-run-modal .modal-header h3 { margin-top: 6px; }
.e2e-run-meta { margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.e2e-run-meta code { font-size: 12px; }
.e2e-run-header-actions { display: flex; align-items: center; gap: 12px; }
.e2e-run-header-actions .e2e-link { display: inline-flex; align-items: center; gap: 4px; }
.e2e-run-header-actions .e2e-link i { width: 14px; height: 14px; }

.e2e-tabs { display: flex; align-items: center; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--border-color); }
.e2e-tab {
  background: none; border: none; border-bottom: 2px solid transparent; padding: 12px 14px; cursor: pointer;
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
}
.e2e-tab:hover:not(:disabled) { color: var(--text-primary); }
.e2e-tab.active { color: var(--text-primary); border-bottom-color: var(--brand-primary); }
.e2e-tab:disabled { opacity: 0.4; cursor: not-allowed; }
.e2e-newtab { margin-left: auto; font-size: 12px; color: #a5b4fc; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.e2e-newtab i { width: 12px; height: 12px; }

.e2e-run-body { flex: 1; min-height: 0; position: relative; }
.e2e-pane { display: none; height: 100%; }
.e2e-pane.active { display: block; }
.e2e-pane[data-e2e-pane="summary"] { overflow: auto; padding: 20px 24px 28px; }
#e2e-report-frame { width: 100%; height: 100%; border: 0; background: #fff; display: block; }

.e2e-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.e2e-kpi {
  background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.e2e-kpi b { font-family: var(--font-head); font-size: 24px; font-variant-numeric: tabular-nums; }
.e2e-kpi span { font-size: 12px; color: var(--text-secondary); }
.e2e-kpi.ok b { color: #34d399; }
.e2e-kpi.bad b { color: #f87171; }
.e2e-kpi.warn b { color: #fbbf24; }

.e2e-note { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; border: 1px solid var(--border-color); }
.e2e-note.ok { background: rgba(16, 185, 129, 0.08); color: #a7f3d0; }
.e2e-note.bad { background: rgba(239, 68, 68, 0.08); color: #fecaca; }

.e2e-h { font-family: var(--font-head); font-size: 15px; margin: 18px 0 10px; }
.e2e-failures { padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.e2e-failures li::marker { color: var(--text-muted); }
.e2e-f-title { font-size: 14px; line-height: 1.5; }
.e2e-f-feature { font-weight: 600; }
.e2e-f-loc { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.e2e-key { font-size: 11px; margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: rgba(99, 102, 241, 0.18); color: #c7d2fe; }
.e2e-f-error {
  margin-top: 4px; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; color: #fca5a5;
  overflow-wrap: anywhere;
}
.e2e-failures details summary, .e2e-md summary { cursor: pointer; font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.e2e-pre {
  margin-top: 6px; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-color);
  font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 340px; overflow: auto;
}
.e2e-flaky { padding-left: 20px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.e2e-md { margin-top: 18px; }

.e2e-ticket-preview {
  border: 1px solid var(--border-focus); background: rgba(99, 102, 241, 0.06); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
}
.e2e-tp-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.e2e-tp-head .btn-row { margin: 0; }
.e2e-tp-summary { margin-top: 10px; font-weight: 600; }
.e2e-tp-desc { max-height: 260px; }

@media (max-width: 760px) {
  .e2e-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal.e2e-run-modal { height: 96vh; max-width: 100vw; }
  .e2e-tabs { padding: 0 12px; overflow-x: auto; }
  .e2e-newtab { display: none; }
}

/* Videos tab: one player per recorded scenario */
.e2e-tab-count { font-size: 11px; color: var(--text-muted); margin-left: 2px; }
.e2e-pane[data-e2e-pane="videos"] { overflow: auto; padding: 16px 24px 28px; }
.e2e-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.e2e-chip {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-color); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; color: var(--text-secondary); cursor: pointer;
}
.e2e-chip b { color: var(--text-primary); margin-left: 4px; font-variant-numeric: tabular-nums; }
.e2e-chip.active { border-color: var(--brand-primary); color: var(--text-primary); background: rgba(99, 102, 241, 0.15); }
.e2e-chip:disabled { opacity: 0.4; cursor: default; }
.e2e-video-note { font-size: 12px; margin-bottom: 12px; }
.e2e-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.e2e-video {
  margin: 0; background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.e2e-video video { width: 100%; aspect-ratio: 16 / 10; background: #000; display: block; }
.e2e-video figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.e2e-video-title { line-height: 1.4; }
.e2e-video-dl { font-size: 12px; align-self: flex-start; }
.e2e-vc { font-size: 11px; color: var(--text-secondary); margin-left: 6px; white-space: nowrap; }
@media (max-width: 760px) {
  .e2e-video-grid { grid-template-columns: 1fr; }
  .e2e-pane[data-e2e-pane="videos"] { padding: 12px; }
}

/* One run (pipeline) per product, its jobs as rows; older runs in the selector */
.e2e-product-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.e2e-product-head > div:first-child { flex: 1 1 360px; min-width: 0; }
.e2e-run-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.e2e-run-select { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.e2e-run-select select {
  background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; max-width: 420px;
}
.e2e-jobcell { white-space: normal !important; }
.e2e-job-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.e2e-partial { font-size: 11px; color: #fbbf24; }
.e2e-manual {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  text-transform: uppercase; background: rgba(99, 102, 241, 0.18); color: #c7d2fe;
}
@media (max-width: 760px) {
  .e2e-run-select, .e2e-run-select select { width: 100%; max-width: none; }
}
