/* v0.33.0 administrator: "Lietotāji" activity panel, the test-document reading and the diagnostics explanations.
   Colours come from the shared tokens in styles.css, so the dark theme follows automatically. */

/* ---------------------------------------------------------------- users list: rows that open their activity */
.au-table tr.au-row { cursor: pointer; }
.au-table tr.au-row:hover > td { background: var(--elevated); }
.au-table tr.au-open > td { background: var(--blue-light); }
.au-table .au-toggle { display: inline-flex; align-items: center; margin-top: 6px; min-height: 32px; padding: 0 10px; white-space: nowrap; }
.au-table .au-panel-row > td { padding: 0; background: var(--canvas-alt); border-bottom: 1px solid var(--line-strong); }
.au-panel { position: sticky; left: 0; box-sizing: border-box; max-width: 100%; padding: 14px 12px 16px; white-space: normal; text-align: left; }
.au-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.au-panel-head h3 { margin: 0; font-size: 1rem; }
.au-notice { margin: 6px 0 0; }
.au-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.au-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: .85rem; cursor: pointer; }
.au-chip[aria-pressed="true"] { background: var(--blue-light); border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); color: var(--blue); font-weight: 600; }
.au-count { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.au-count:empty { display: none; }
.au-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.au-item { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: var(--radius); padding: 10px 12px; overflow-wrap: anywhere; }
.au-item[data-status="ok"] { border-left-color: var(--verified); }
.au-item[data-status="failed"] { border-left-color: var(--compromised); }
.au-item[data-status="pending"] { border-left-color: var(--suspected); }
.au-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); }
.au-head time { font-variant-numeric: tabular-nums; }
.au-kind { color: var(--ink-muted); }
.au-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.au-head .au-badge { margin-left: auto; }
.au-ok { background: var(--verified-light); color: var(--verified); }
.au-failed { background: var(--compromised-light); color: var(--compromised); }
.au-pending { background: var(--suspected-light); color: var(--suspected); }
.au-title { margin: 4px 0 0; font-weight: 600; }
.au-meta, .au-tech { margin: 4px 0 0; font-size: .82rem; color: var(--ink-2); }
.au-tech code, .au-review code, .au-attempts code, .dt-summary code, .aic-explain code {
  font-size: .78rem; background: var(--canvas-alt); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.au-model { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.au-why { margin-top: 6px; padding: 8px 10px; border-radius: var(--radius); background: var(--compromised-light); }
.au-why p { margin: 0; }
.au-why .au-tech { margin-top: 4px; }
.au-review { margin-top: 6px; font-size: .85rem; }
.au-review p { margin: 0; }
.au-reasons, .au-candidates { margin: 4px 0 0; padding-left: 20px; }
.au-reasons li, .au-candidates li { margin: 2px 0; }
.au-cand-label { font-weight: 600; }
.au-why-text { color: var(--ink-2); }
.au-attempts { margin-top: 6px; font-size: .85rem; }
.au-attempts summary { cursor: pointer; color: var(--blue); min-height: 28px; display: flex; align-items: center; }
.au-attempts ol { margin: 4px 0 0; padding-left: 20px; }
.au-loading, .au-empty { margin: 10px 0 0; }
.au-error { color: var(--compromised); }

/* ---------------------------------------------------------------- Iestatījumi: test-document reading */
.dt-form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.dt-form label { display: flex; flex-direction: column; gap: 4px; }
.dt-form label.check { flex-direction: row; align-items: flex-start; gap: 8px; }
.dt-form .actions { margin: 0; }
.dt-status { margin: 0; min-height: 1.2em; }
.dt-result { margin-top: 14px; }
.dt-summary { padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--elevated); overflow-wrap: anywhere; }
.dt-summary p { margin: 0 0 6px; }
.dt-summary .au-badge { margin-right: 6px; }
.dt-ok { border-color: color-mix(in srgb, var(--verified) 40%, var(--line)); }
.dt-failed { border-color: color-mix(in srgb, var(--compromised) 40%, var(--line)); background: var(--compromised-light); }
.dt-table { margin-top: 4px; }
.dt-notes { margin: 6px 0 0; padding-left: 18px; }
.dt-json-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dt-json-head h3 { margin: 0; font-size: 1rem; }
.dt-json-head button { min-height: 36px; }
.dt-json { max-height: 420px; overflow: auto; margin: 8px 0 0; padding: 12px; border-radius: var(--radius); background: var(--canvas-alt);
  border: 1px solid var(--line); color: var(--ink); font: .8rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; tab-size: 2; }

/* ---------------------------------------------------------------- AI diagnostics: what the codes mean */
.aic-explain { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--elevated); font-size: .88rem; }
.aic-explain h4 { margin: 0 0 6px; font-size: .9rem; }
.aic-explain dl { margin: 0; }
.aic-explain dt { margin-top: 6px; font-weight: 600; }
.aic-explain dd { margin: 2px 0 0; color: var(--ink-2); }

@media (max-width: 700px) {
  .au-panel { padding: 12px 8px 14px; }
  .au-head .au-badge { margin-left: 0; }
  .au-chip { padding: 0 10px; }
  .dt-json { max-height: 320px; font-size: .74rem; }
}
