/* /studio/history.css — page-scoped styles for the audit history view.
   Reuses tokens + base components from /studio/studio.css; only the
   table + toolbar specifics live here. */

.history-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.history-toolbar .row-status {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.history-toolbar .row-status .mono {
  color: var(--text);
}

.exports {
  display: flex;
  gap: 8px;
}

.history-card {
  padding: 0;
  overflow: hidden;
}

.history-table-wrap {
  max-height: calc(100vh - 280px);
  overflow: auto;
  border-radius: inherit;
  /* Subtle right-edge mask hints horizontal scroll on narrow viewports
     where the 9-column table overflows. The shadow only renders on
     scrollable wrappers (default behaviour of mask-image clipping). */
  background:
    linear-gradient(to right, var(--surface, #0F172A), transparent 8px) left center / 8px 100% no-repeat,
    linear-gradient(to left, var(--surface, #0F172A), transparent 8px) right center / 8px 100% no-repeat,
    linear-gradient(to right, rgba(0,0,0,0.25), transparent 4px) right center / 4px 100% no-repeat;
  background-attachment: local, local, scroll;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.history-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface, #0F172A);
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #94A3B8);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #1E293B);
  z-index: 1;
}

.history-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, #1E293B);
  vertical-align: middle;
}

.history-table tbody tr:hover {
  background: var(--row-hover, rgba(125, 211, 252, 0.04));
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-table .col-when {
  white-space: nowrap;
  color: var(--muted, #94A3B8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.history-table .col-task {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted, #94A3B8);
}

.history-table .col-task code,
.history-table .col-task .task-id-copy {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--code-bg, rgba(125, 211, 252, 0.06));
  color: var(--text);
  font: inherit;
  border: 0;
  /* native button reset so the copy control inherits the same look as the
     legacy <code> element while remaining keyboard-focusable */
}

.history-table .col-task code:hover,
.history-table .col-task .task-id-copy:hover,
.history-table .col-task .task-id-copy:focus-visible {
  background: var(--code-bg-hover, rgba(125, 211, 252, 0.12));
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.history-table .col-task .task-id-copy:focus-visible {
  box-shadow: 0 0 0 2px var(--focus-ring, #7DD3FC);
}

.verdict-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.verdict-pill[data-verdict="SAFE"] {
  background: rgba(34, 197, 94, 0.12);
  color: #4ADE80;
}

.verdict-pill[data-verdict="CONFLICT"] {
  background: rgba(239, 68, 68, 0.14);
  color: #F87171;
}

.verdict-pill[data-verdict="UNVERIFIED"] {
  background: rgba(148, 163, 184, 0.14);
  color: #CBD5E1;
}

.verdict-pill[data-verdict="PARTIAL"] {
  background: rgba(251, 191, 36, 0.14);
  color: #FCD34D;
}

.verdict-pill[data-verdict="BLOCK"] {
  background: rgba(225, 29, 72, 0.18);
  color: #FB7185;
}

.verdict-pill[data-verdict="INSUFFICIENT_CLAIMS"],
.verdict-pill[data-verdict="UNCERTAIN"] {
  background: rgba(125, 211, 252, 0.10);
  color: #7DD3FC;
}

.history-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border, #1E293B);
}

.history-foot #load-more {
  margin-left: auto;
}

.history-disabled,
.history-empty {
  text-align: center;
  padding: 48px 24px;
}

.history-disabled h3,
.history-empty h3 {
  margin-bottom: 8px;
}

.history-disabled code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--code-bg, rgba(125, 211, 252, 0.06));
  padding: 2px 6px;
  border-radius: 4px;
}
