/* ================= ACTIVITY & AUDIT TRAIL — the table, the filter bar, the pager =============
   One of four Team Insights sheets on team_board.html; owns `ti-aud-` (css-class-collision-check.py
   enforces it). Same shape as alt-user-traffic.css's admin log. Tokens only; state is never colour
   alone (design-system §20). */

/* ---------- the panel, when tiPanel() (Agent 3's shell) is not reachable ----------
   Defensive fallback only — a load-order slip degrades to a plain legible block instead of
   unstyled text on the dialog body. */
.alt-app .ti-aud-fallback-panel{
  display:flex; flex-direction:column; gap:var(--a-4);
  padding:var(--a-4); border:1px solid var(--a-line); border-radius:var(--a-r-lg);
  background:var(--a-panel);
}
.alt-app .ti-aud-fallback-msg{ margin:0; color:var(--a-dim); font-size:var(--a-fs-ctl); }
/* `.a-btn secondary` carries the button; this adds the one thing the shared class has no opinion
   about — not stretching to the width of a flex column. See THE CONTROLS below. */
.alt-app .ti-aud-fallback-retry{ align-self:flex-start; }

/* ---------- the state block's own container ----------
   `.ti-aud-state` wraps tiStateEmpty()/tiStateError() — needs a geometry-free wrapper
   (`display:contents`) because passing those functions `body` directly erased the filter bar
   and horizon note on every empty/error render; a dedicated child container fixes it. */
.alt-app .ti-aud-state{ display:contents; }

/* ---------- the horizon note ----------
   Recording began recently — a reader who opens a long range and sees a handful of rows must be
   told the record doesn't reach back that far. Styled as a note, not an error: it explains an
   answer, it does not report a failure. */
/* Amber coverage role, shared with the other views (see alt-team-insights-engagement.css):
   "the record does not reach back that far". Recording began on a date, so a long range returns
   fewer rows than expected. Same padding, border, radius and type as `.ti-eng-horizon`. */
.alt-app .ti-aud-horizon{
  margin:0; padding:var(--a-3); min-width:0;
  border:1px solid var(--a-amber); border-left-width:3px; border-radius:var(--a-r);
  background:var(--a-amber-soft); color:var(--a-text);
  font-size:var(--a-fs-ctl-sm); line-height:var(--a-lh-ui); font-weight:600; overflow-wrap:anywhere;
}

/* ---------- the filter bar ----------
   Wraps rather than scrolls — three controls (Action, Item, Clear) read correctly as a
   flex-wrap row from full width down to a phone with no dedicated breakpoint; the one
   breakpoint below only widens touch targets on the narrowest screens. */
.alt-app .ti-aud-filters{
  display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--a-3);
}
/* `--a-1` (4px), not a literal 4 — the same gap `.ti-f` and `.ti-custom-f` put between a caption
   and its control. The value was already right; writing it as a number meant a change to the
   scale would move three of the four filter rows in this dialog and leave this one behind. */
.alt-app .ti-aud-f{
  display:flex; flex-direction:column; gap:var(--a-1); min-width:0;
}
/* Caption tier shared across this dialog: 10px / 700 / .09em, same as `.ti-f-l`, `.ti-custom-l`
   (alt-team-insights.css) and `.ti-eng-groups-l` (alt-team-insights-engagement.css). */
.alt-app .ti-aud-f-lbl{
  font-size:var(--a-fs-11); font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  color:var(--a-dim);
}
/* The controls are the suite's own (`.a-select` / `.a-btn`, CSS/alt/alt-components.css), as in the
   shell (`a-select ti-range-sel`, `a-btn secondary ti-f-clear`) and User Engagement
   (`a-input ti-eng-search-input`). JS/features/team-insights-audit.js emits the shared classes;
   only width floors and flex alignment are left here, because the shared class has no opinion. */
.alt-app .ti-aud-f-sel{ min-width:160px; max-width:100%; }
.alt-app .ti-aud-clear{ align-self:flex-end; }

@media (max-width:639px){
  .alt-app .ti-aud-f{ flex:1 1 100%; }
  .alt-app .ti-aud-f-sel{ min-width:0; width:100%; }
  .alt-app .ti-aud-clear{ align-self:stretch; }
}

/* ---------- the air between the blocks ----------
   `.ti-panel-b` (alt-team-insights.css) is `display:block` with no gap and the blocks carry no margin,
   so they sat flush. Uses `:not(:first-child)`, not `+` pairs: the blocks are conditional and
   `.ti-aud-state` (`display:contents`) can sit between any two. `--a-4` is the panel's content gap. */
.alt-app .ti-aud-ct:not(:first-child),
.alt-app .ti-aud-filters:not(:first-child),
.alt-app .ti-aud-tscroll:not(:first-child),
.alt-app .ti-aud-pager:not(:first-child){ margin-top:var(--a-4); }

/* ---------- the table ---------- */
.alt-app .ti-aud-tscroll{
  overflow-x:auto; overscroll-behavior-x:contain; min-width:0;
  border:1px solid var(--a-line); border-radius:var(--a-r-lg);
}
.alt-app .ti-aud-table{
  border-collapse:collapse; width:100%; min-width:560px; font-size:var(--a-fs-ctl-sm);
}
/* Column-heading voice matches the member table (`.ti-eng-table th`): 10px / 700 / .09em. The
   sticky header stays because this table scrolls inside a fixed-height dialog. */
.alt-app .ti-aud-table th{
  position:sticky; top:0; background:var(--a-raised); color:var(--a-dim);
  text-align:left; font-size:var(--a-fs-11); font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  padding:var(--a-2) var(--a-3); border-bottom:1px solid var(--a-line);
  white-space:nowrap;
}
.alt-app .ti-aud-table td{
  padding:var(--a-2) var(--a-3); border-bottom:1px solid var(--a-line-soft);
  color:var(--a-text); vertical-align:top;
}
.alt-app .ti-aud-table tr:last-child td{ border-bottom:none; }
.alt-app .ti-aud-when{
  white-space:nowrap; font-variant-numeric:tabular-nums; color:var(--a-dim);
}
.alt-app .ti-aud-details{ color:var(--a-dim); }

/* An absent actor is styled as an absence, not a smaller name — italic plus muted survives a
   reader who cannot separate the two colours (design-system §20), and is never the only signal. */
.alt-app .ti-aud-noactor{ color:var(--a-faint); font-style:italic; }

/* ---------- empty / clear-filters-from-inside-the-empty-state ---------- */
/* `.a-btn secondary` again — the same Clear button as the filter bar's, because it is the same
   action. Only the air above it is this view's own; `.ti-state-btn` (the shell's equivalent inside
   its own empty state) uses `--a-1`, and this sits under a paragraph rather than a heading. */
.alt-app .ti-aud-empty-clear{ margin-top:var(--a-2); }

/* ---------- pagination ----------
   The range label ("Showing 1–50 of 214") is the reader's orientation, not decoration — it sits
   between the two buttons rather than beside just one of them. */
.alt-app .ti-aud-pager{
  display:flex; align-items:center; justify-content:space-between; gap:var(--a-3);
  flex-wrap:wrap;
}
.alt-app .ti-aud-range{
  font-size:var(--a-fs-ctl-sm); color:var(--a-dim); font-variant-numeric:tabular-nums;
}
/* The pager buttons are `.a-btn`, which already owns size, border, hover, focus and the disabled
   treatment (reduced opacity plus no pointer, never colour alone). The selectors remain only as
   hooks for JS/features/team-insights-audit.js and the suite. */

@media (max-width:639px){
  .alt-app .ti-aud-pager{ justify-content:space-between; }
  .alt-app .ti-aud-range{ order:3; flex:1 1 100%; text-align:center; }
}
