/* IT & Audit · Automation Testing dashboard
   Matches Prime RP look (Bootstrap 5.3 + --ax-* tokens). Light & dark themes.
*/

#auditAutomation {
  --ax-pass: #198754;
  --ax-fail: #dc3545;
  --ax-warn: #fd7e14;
  --ax-skip: #6c757d;
  --ax-info: #0d6efd;
}

#auditAutomation .ax-filter-card {
  background: var(--ax-card, #fff);
  border-color: var(--ax-border, #e5e7eb);
}

#auditAutomation .ax-test-row {
  background: var(--ax-card, #fff);
  border-color: var(--ax-border, #e5e7eb);
  transition: border-color .15s ease, box-shadow .15s ease;
}

#auditAutomation .ax-test-row[data-last-status="pass"]   { border-left: 3px solid var(--ax-pass); }
#auditAutomation .ax-test-row[data-last-status="fail"]   { border-left: 3px solid var(--ax-fail); }
#auditAutomation .ax-test-row[data-last-status="running"]{ border-left: 3px solid var(--ax-info); animation: pulseBorder 1.2s ease-in-out infinite; }
#auditAutomation .ax-test-row[data-last-status="never"]  { border-left: 3px solid var(--ax-border, #e5e7eb); }

@keyframes pulseBorder {
  0%,100% { box-shadow: 0 0 0 0 rgba(13,110,253,.0); }
  50%     { box-shadow: 0 0 0 6px rgba(13,110,253,.15); }
}

#auditAutomation .ax-status         { font-weight: 600; }
#auditAutomation .ax-status.pass    { background: rgba(25,135,84,.12); color: var(--ax-pass); }
#auditAutomation .ax-status.fail    { background: rgba(220,53,69,.12); color: var(--ax-fail); }
#auditAutomation .ax-status.running { background: rgba(13,110,253,.12); color: var(--ax-info); }
#auditAutomation .ax-status.never   { background: rgba(108,117,125,.12); color: var(--ax-skip); }

#auditAutomation .ax-cat            { font-weight: 500; font-size: .75rem; }
#auditAutomation .ax-cat.cat-Microservice { background: rgba(13,110,253,.12); color: #0d6efd; }
#auditAutomation .ax-cat.cat-LegacyAPI    { background: rgba(132,90,223,.12); color: #845adf; }
#auditAutomation .ax-cat.cat-Workflow     { background: rgba(253,126,20,.12); color: #fd7e14; }
#auditAutomation .ax-cat.cat-UI           { background: rgba(32,201,151,.12); color: #20c997; }
#auditAutomation .ax-cat.cat-Integration  { background: rgba(214,51,132,.12); color: #d63384; }

#auditAutomation .ax-target { word-break: break-all; }

/* Path panel — the trace */
#auditAutomation .ax-path-panel {
  background: var(--ax-soft, #f1f5f9);
  border: 1px solid var(--ax-border, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
}

#auditAutomation .ax-step {
  display: grid;
  grid-template-columns: 32px 60px 1fr auto auto;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: var(--ax-card, #fff);
  border: 1px solid var(--ax-border, #e5e7eb);
  font-size: .85rem;
}

#auditAutomation .ax-step .step-icon  { text-align: center; }
#auditAutomation .ax-step .step-method{
  font-family: ui-monospace, monospace; font-weight: 700; font-size: .75rem;
  border-radius: 4px; padding: 1px 4px; text-align: center; align-self: start;
}
#auditAutomation .ax-step .step-method.GET    { background: rgba(13,110,253,.12); color: #0d6efd; }
#auditAutomation .ax-step .step-method.POST   { background: rgba(25,135,84,.12); color: #198754; }
#auditAutomation .ax-step .step-method.PUT    { background: rgba(253,126,20,.12); color: #fd7e14; }
#auditAutomation .ax-step .step-method.PATCH  { background: rgba(132,90,223,.12); color: #845adf; }
#auditAutomation .ax-step .step-method.DELETE { background: rgba(220,53,69,.12); color: #dc3545; }
#auditAutomation .ax-step .step-method.ASSERT { background: rgba(108,117,125,.12); color: #6c757d; }
#auditAutomation .ax-step .step-method.CALLABLE { background: rgba(102, 16, 242, .12); color: #6610f2; }
#auditAutomation .ax-step .step-method.NOTE   { background: rgba(13,202,240,.10); color: #0dcaf0; }

#auditAutomation .ax-step .step-url   { font-family: ui-monospace, monospace; word-break: break-all; }
#auditAutomation .ax-step .step-status{ font-weight: 600; align-self: center; }
#auditAutomation .ax-step .step-status.s-ok   { color: var(--ax-pass); }
#auditAutomation .ax-step .step-status.s-fail { color: var(--ax-fail); }
#auditAutomation .ax-step .step-dur   { color: var(--ax-muted, #6b7280); font-size: .8rem; align-self: center; }

#auditAutomation .ax-step pre.payload {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding: 8px 10px;
  background: var(--ax-bg, #f4f6f9);
  border: 1px solid var(--ax-border, #e5e7eb);
  border-radius: 4px;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: .75rem;
  font-family: ui-monospace, monospace;
}

#auditAutomation .ax-assertion-row {
  display: flex; gap: 8px; align-items: center;
  padding: 4px 0;
  font-size: .85rem;
}
#auditAutomation .ax-assertion-row.pass .check { color: var(--ax-pass); }
#auditAutomation .ax-assertion-row.fail .check { color: var(--ax-fail); }
#auditAutomation .ax-assertion-row .det        { color: var(--ax-muted, #6b7280); font-size: .8rem; }

/* dark theme */
html[data-theme="dark"] #auditAutomation .ax-test-row,
html[data-theme="dark"] #auditAutomation .ax-step,
html[data-theme="dark"] #auditAutomation .ax-filter-card {
  background: var(--ax-card, #111a2b);
}
html[data-theme="dark"] #auditAutomation .ax-step pre.payload {
  background: var(--ax-input, #0b1220);
  color: #e5e7eb;
}
