/* events: page styles on top of the design-system primitives in /styles.css.
   Tokens only (var(--...)); no hex, no rgba, no new hues.
   Covers #/events, #/admin/event-types, #/transfers, #/anomalies, #/anomaly/<id>. */

/* ── List pages: segmented tabs + filter popover, then feed rows ── */
.evt-filter-btn .seg-n:empty { display: none; }
.evt-pop { width: min(320px, calc(100vw - 32px)); }
.evt-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42ch; }
/* Rows show status as icon + words in their own column, so no leading glyph column. */
.evt-feed .feed-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.row-status .status { gap: 0; }

/* ── Detail drawer / dialog content ───────────────────────────── */
.evt-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: var(--fs-meta); color: var(--ink-3); }
.evt-meta .status { font-size: var(--fs-meta); }
.evt-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.evt-text { color: var(--ink); margin: 20px 0 0; white-space: pre-wrap; }
.evt-note { color: var(--ink-2); font-size: var(--fs-ui); margin: 12px 0 0; white-space: pre-wrap; }
.evt-sec { margin-top: 28px; }
.evt-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.evt-sec-head h3 { font-size: var(--fs-section); font-weight: 700; }
.evt-sec details { margin-top: 8px; }
.evt-sec summary, .evt-details summary { cursor: pointer; color: var(--ink-3); font-size: var(--fs-meta); }
.evt-details { margin-top: 16px; }
.evt-details pre, .evt-sec pre { margin-top: 8px; }
.evt-audit { list-style: none; margin: 0; padding: 0; }
.evt-audit > li { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.evt-audit > li:last-child { border-bottom: 0; }
.evt-audit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.evt-audit-row > span:last-child { font-size: var(--fs-meta); color: var(--ink-3); }
.evt-links td { font-size: var(--fs-ui); }
.evt-links td.right { width: 1%; white-space: nowrap; }

/* ── Forms inside drawers and dialogs ─────────────────────────── */
.evt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.evt-form-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--line-2); }

/* AI document drop zone: hairline dashed, --soft while dragging over. */
.evt-drop {
  border: 1px dashed var(--line); border-radius: var(--r-md);
  padding: 20px 16px; background: var(--panel); color: var(--ink);
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.evt-drop[data-state="idle"], .evt-drop[data-state="failed"] { cursor: pointer; }
.evt-drop[data-state="idle"]:hover, .evt-drop[data-state="failed"]:hover,
.evt-drop.is-over { background: var(--soft); border-color: var(--ink-3); }
.evt-drop-idle { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.evt-drop-idle > svg { color: var(--ink-3); }
.evt-drop-title { font-weight: 600; font-size: var(--fs-ui); }
.evt-drop-sub { font-size: var(--fs-meta); color: var(--ink-3); }
.evt-drop-busy { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-ui); }
.evt-drop-busy > span:last-child { color: var(--ink-3); }
.evt-drop-failed { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-ui); color: var(--alert-ink); }
.evt-drop-failed > svg { color: var(--alert); margin-top: 2px; }
.evt-drop-failed u { color: var(--ink-2); }
.evt-drop-ready { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.evt-drop-ready .evt-drop-sub { margin-top: 4px; }
.evt-drop-ready ul { margin: 6px 0 0 18px; padding: 0; font-size: var(--fs-meta); color: var(--ink-3); }

/* ── Event categories (drawer + admin page) ───────────────────── */
.evt-types-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.evt-types-intro p { margin: 0; color: var(--ink-3); font-size: var(--fs-ui); }
.evt-types-h { font-size: var(--fs-section); font-weight: 700; margin: 0 0 6px; }
.evt-types-h + .feed-list, .evt-types-h + .state { margin-bottom: 28px; }

/* ── Transfers detail ─────────────────────────────────────────── */
.trf-party { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.trf-party:last-child { border-bottom: 0; }
.trf-party-label { font-size: var(--fs-meta); color: var(--ink-3); }
.trf-party-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.trf-party-sub { font-size: var(--fs-meta); color: var(--ink-3); }

/* ── Anomaly detail ───────────────────────────────────────────── */
.anom-meta { margin: -12px 0 28px; }
.anom-values { margin-bottom: 40px; }
.anom-values .figure-label { display: block; margin-bottom: 8px; }
.anom-sec { margin: 0 0 40px; }
.anom-sec > h2 { margin: 0 0 12px; }
.anom-ev { border-top: 1px solid var(--line-2); padding: 14px 0; }
.anom-ev:last-child { border-bottom: 1px solid var(--line-2); }
.anom-ev summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.anom-ev summary > span { font-weight: 400; color: var(--ink-3); font-size: var(--fs-meta); }
.anom-ev pre { margin-top: 10px; }
.anom-ev--empty { display: flex; gap: 8px; font-weight: 600; }
.anom-ev--empty > span { font-weight: 400; color: var(--ink-3); }

@media (max-width: 640px) {
  /* Title and meta on top, then status and tags on one line. */
  .evt-feed .feed-row { grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; }
  .evt-feed .row-body { grid-column: 1 / -1; }
  .evt-feed .feed-row > :empty { display: none; }
  .evt-feed .feed-tags { justify-content: flex-start; }
  .evt-types-intro { flex-direction: column; }
  .evt-clip { max-width: 22ch; }
}
